scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | README | LICENSE

commit 1b7357c51fd821de8fd48990e76fbff97077c0ae
parent 83b9dca98ed2dc75629571cce13d59cc59d15dd5
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Mon, 12 Mar 2018 20:34:30 +0100

[nm] Fix detection of member in archives

The old code was using the additional '\0'.

Diffstat:
Mnm/main.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nm/main.c b/nm/main.c @@ -69,7 +69,7 @@ ar(char *fname, FILE *fp) while (fread(&hdr, sizeof(hdr), 1, fp) == 1) { pos = ftell(fp); - if (strncmp(hdr.ar_fmag, ARFMAG, SARMAG)) + if (strncmp(hdr.ar_fmag, ARFMAG, sizeof(hdr.ar_fmag))) goto corrupted; siz = 0;