--- ray/src/util/rcode_ident.c 2019/07/23 17:20:20 2.3 +++ ray/src/util/rcode_ident.c 2019/07/24 00:17:22 2.5 @@ -1,5 +1,5 @@ #ifndef lint -static const char RCSid[] = "$Id: rcode_ident.c,v 2.3 2019/07/23 17:20:20 greg Exp $"; +static const char RCSid[] = "$Id: rcode_ident.c,v 2.5 2019/07/24 00:17:22 greg Exp $"; #endif /* * Create or read identifier index map @@ -91,7 +91,7 @@ create_index(const char *fname, int hdrflags, int ndxb char **idmap; int idmlen; int nextID = 0; - LUTAB hashtab = LU_SINIT(free,NULL); + LUTAB hashtab; RESOLU rs; long n; int ndx; @@ -134,6 +134,10 @@ create_index(const char *fname, int hdrflags, int ndxb fputs(": unsupported bits/pixel\n", stderr); return 0; } + memset(&hashtab, 0, sizeof(hashtab)); + hashtab.hashf = lu_shash; + hashtab.keycmp = strcmp; + hashtab.freek = free; if (!idmap || !lu_init(&hashtab, idmlen)) goto memerr; fputc('\n', stdout); /* end of info header */ @@ -314,7 +318,7 @@ decode_all(const char *fname, int hdrflags) if (numeric) { printf("%d", ndx); } else { - const char *id = idmap_next(idmp); + const char *id = mapID(idmp, ndx); if (!id) { fputs(fname, stderr); fputs(": bad ID index in file\n", stderr);