commit 49ad9073f0ae0db7c459cba3e41dfccaa95c7abe
parent 77f7bee754210661f4bcf5cdcdebdb3058bb8a8b
Author: Roberto E. Vargas Caballero <k0ga@shike2.net>
Date: Fri, 8 May 2026 09:52:11 +0200
ranlib: Fix offset calculation
After reading th header of an archive member the file
pointer is already located at the end of the header
and armember returns the offset from the beginning
of the archive header, so we have to use the cur variable
instead of the offset in the file pointer.
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/cmd/scc-ranlib.c b/src/cmd/scc-ranlib.c
@@ -196,7 +196,7 @@ readsyms(FILE *fp)
goto corrupted;
if (strcmp(memb, "/") == 0 || strcmp(memb, "__.SYMDEF") == 0)
- cur = ftell(fp) + off;
+ cur += off;
fseek(fp, cur, SEEK_SET);
for (;;) {