Bug#2638: unstable/man loops building index with empty man pages
Sigh. This was an easy one.
(1) never throw away return status
(2) with fgets, the *returned value* is NULL on error/eof; there
is no way it can change "buffer", which is just a pointer
to some space on the stack...
Please let me know when a release is expected to have this fixed.
_Mark_ <eichin@cygnus.com>
Cygnus Support, Eastern USA
--- ult_src.c~ Thu Nov 9 16:11:24 1995
+++ ult_src.c Sat Mar 30 23:06:28 1996
@@ -275,7 +275,7 @@
}
if (flags & SO_LINK) {
- char buffer[1024];
+ char buffer[1024], *bptr;
int val;
FILE *fp;
#ifdef COMP_SRC
@@ -320,9 +320,9 @@
#endif
/* make sure that we skip over any comments */
do {
- (void) fgets(buffer, 1024, fp);
+ bptr = fgets(buffer, 1024, fp);
}
- while (buffer && strncmp(buffer, ".\\\"", 3) == 0);
+ while (bptr && strncmp(buffer, ".\\\"", 3) == 0);
fclose(fp);
Reply to: