Thread View: news.software.readers
4 messages
4 total messages
Started by Geoff Collyer
Thu, 01 Jul 1993 00:20
nov update: typo in libnov/lib.c fixed
Author: Geoff Collyer
Date: Thu, 01 Jul 1993 00:20
Date: Thu, 01 Jul 1993 00:20
23 lines
1797 bytes
1797 bytes
world.std.com:src/news/nov.dist.tar.Z has been updated to incorporate
this fix for a silly but hard-to-spot typo, found by Wolfgang Rupprech:
:; diff -c lib.buggy.c lib.c
*** lib.buggy.c Wed Jun 30 20:18:00 1993
--- lib.c Wed Jun 30 19:37:10 1993
***************
*** 131,137 ****
if (len > 0 && line[len-1] == '\n')
line[len-1] = '\0'; /* make field count straightforward */
nf = split(line, fields, MAXFIELDS, "\t");
! if (nf < MAXFIELDS - 1) /* only "others" fields are optional
return PRSBAD; /* skip this line */
while (nf < MAXFIELDS)
fields[nf++] = ""; /* fake missing fields */
--- 131,137 ----
if (len > 0 && line[len-1] == '\n')
line[len-1] = '\0'; /* make field count straightforward */
nf = split(line, fields, MAXFIELDS, "\t");
! if (nf < MAXFIELDS - 1) /* only "others" fields are optional */
return PRSBAD; /* skip this line */
while (nf < MAXFIELDS)
fields[nf++] = ""; /* fake missing fields */
Re: nov update: typo in libnov/lib.c fixed
Author: Bruce Lilly
Date: Fri, 02 Jul 1993 00:54
Date: Fri, 02 Jul 1993 00:54
16 lines
1482 bytes
1482 bytes
In article <C9GM9y.A5v@well.sf.ca.us>, posted to news.software.b,news.software.readers, geoff@well.sf.ca.us (Geoff Collyer) wrote: >this fix for a silly but hard-to-spot typo, found by Wolfgang Rupprech: [...] >! if (nf < MAXFIELDS - 1) /* only "others" fields are optional > return PRSBAD; /* skip this line */ Though I haven't yet installed nov, I usually compile C code with gcc ... -Wall -Wshadow -Wpointer-arith -Wcast-qual -Wwrite-strings (call me paranoid, or call me a voyeur, if it makes you feel good) which in this case would report a warning about /* within a comment, which may be an indication of a missing or hidden */. -- Bruce Lilly ...uupsi!monymsys!sonyd1!blilly!bruce
Re: nov update: typo in libnov/lib.c fixed
Author: Geoff Collyer
Date: Fri, 02 Jul 1993 18:19
Date: Fri, 02 Jul 1993 18:19
4 lines
995 bytes
995 bytes
I'm aware that "gcc -Wall" would have mentioned this particular bug. Unfortunately, in my experience, gcc -Wall complains so loud and long about correct code that it's hard to see the real errors for the noise. (No, I don't remember specifics.)
Re: nov update: typo in libnov/lib.c fixed
Author: Paul Eggert
Date: Fri, 02 Jul 1993 22:09
Date: Fri, 02 Jul 1993 22:09
8 lines
1085 bytes
1085 bytes
geoff@well.sf.ca.us (Geoff Collyer) writes: >I'm aware that "gcc -Wall" would have mentioned this particular bug. >Unfortunately, in my experience, gcc -Wall complains so loud and long >about correct code that it's hard to see the real errors for the noise. You might try `gcc -Wcomment'; it should warn only about comments nested inside comments.
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads