Path: utzoo!yunexus!geac!geaclib!rae From: rae@geaclib.UUCP (Reid Ellis) Newsgroups: comp.sources.bugs Subject: dissect calls fclose with a possibly NULL pointer Keywords: dissect fclose null Message-ID: <3630@geaclib.UUCP> Date: 2 Feb 89 22:33:14 GMT Article-I.D.: geaclib.3630 Reply-To: rae@geaclib.UUCP (Reid Ellis) Organization: T'nir Software Lines: 26 I'm not sure how other systems handle it, but Ultrix does not like fclose() being called with a NULL pointer as an argument. Here is a patch to fix the file "dissect.c": *** dissect.old Thu Feb 2 17:27:02 1989 --- dissect.c Thu Feb 2 17:26:32 1989 *************** *** 46,52 if ((!strncmp (line, "From ", 5)) && (*last == '\n')) { flag++; if (!onlycount) { ! (void) fclose (to); (void) strcpy (name, line+5); for (cp = name; (*cp != ' ') && (*cp != '@') && (*cp != '%'); cp++); *cp = '\0'; --- 46,52 ----- if ((!strncmp (line, "From ", 5)) && (*last == '\n')) { flag++; if (!onlycount) { ! if(to) { (void) fclose (to); } (void) strcpy (name, line+5); for (cp = name; (*cp != ' ') && (*cp != '@') && (*cp != '%'); cp++); *cp = '\0'; Reid