Change History (2)
comment:1 by , 20 years ago
comment:2 by , 20 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
Thanks for pointing out. Actually, in zAVLTree only zAVLSearch matters for the runtime (and the code in sh_hash.c is already fixed in svn), but it's nice to see someone else having a good look at the code and spotting such issues. Comitted as r16.
Note:
See TracTickets
for help on using tickets.
In the same vein, but a different part of the code, if strcmp() returns zero, the strings being compared are guaranteed to be the same length. Thus, the following small patch:
--- sh_hash.c.orig 2006-01-11 21:11:15.000000000 +0100 +++ sh_hash.c 2006-01-12 00:26:32.000000000 +0100 @@ -671,8 +671,7 @@ while (1) { if (p && p->fullpath && - 0 == strcmp(s->fullpath, p->fullpath) && - strlen(s->fullpath) == strlen(p->fullpath)) + 0 == strcmp(s->fullpath, p->fullpath)) { q = p->next; SH_FREE(p->fullpath);