ranlib: Fix offset calculation - scc - simple c99 compiler
HTML git clone git://git.simple-cc.org/scc
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit 49ad9073f0ae0db7c459cba3e41dfccaa95c7abe
DIR parent 77f7bee754210661f4bcf5cdcdebdb3058bb8a8b
HTML 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:
M src/cmd/scc-ranlib.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
---
DIR 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 (;;) {