fix libmach bug, visible under acid. to reproduce the bug: acid /bin/ls acid: filepc("lsxxx:1") acid 1591: suicide: sys: trap: fault read Reference: /n/sources/patch/applied/libmach Date: Sat Jan 22 16:59:04 CET 2005 --- /sys/src/libmach/sym.c Sat Jan 22 16:59:05 2005 +++ /sys/src/libmach/sym.c Sat Jan 22 16:59:04 2005 @@ -356,13 +356,12 @@ return 0; } } - fmax++; - fnames = malloc(fmax*sizeof(*fnames)); + fnames = malloc((fmax+1)*sizeof(*fnames)); if (!fnames) { werrstr("can't malloc file name table"); return 0; } - memset(fnames, 0, fmax*sizeof(*fnames)); + memset(fnames, 0, (fmax+1)*sizeof(*fnames)); files = malloc(nfiles*sizeof(*files)); if(!files) { werrstr("can't malloc file table");