Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83 (MC830919); site kaist.UUCP Path: utzoo!watmath!clyde!akgua!sdcsvax!sdcrdcf!hplabs!kaist!hjpark From: hjpark@kaist.UUCP (HyeonJe Park) Newsgroups: net.bugs.4bsd Subject: RE: bugs in addbib Message-ID: <834@kaist.UUCP> Date: Mon, 7-May-84 14:13:02 EDT Article-I.D.: kaist.834 Posted: Mon May 7 14:13:02 1984 Date-Received: Wed, 9-May-84 03:20:53 EDT Organization: KAIST, Seoul, Republic of Korea Lines: 53 addbib has the another problem yet in spite of the fix of Mr. Plotnick. And so, I post it with his changes. ----------------------------------------------------------------------- Subject: /usr/bin/addbib Index: /usr/src/usr.bin/refer/addbib.c in 4.2BSD Description: After fgets(line,...) is called, and the content of "line" is used, it is not cleared, when we type contl-d. Repeated-By: %addbib test Instructions? y Author: contl-d or %addbib test ... Journal: kaist Volume: contl-d etc... Fix: 8a9,12 > #define clrbuf(buf) { \ > register char *p = buf; \ > while (*p) *p++ = NULL; \ > } 104a109 > clrbuf(line); 106c111,112 < fgets(line, BUFSIZ, stdin); --- > if (!fgets(line, BUFSIZ, stdin)) > goto last; 147a154 > last: 160a168 > clearerr(stdin); 170c178,179 < fgets(line, BUFSIZ, stdin); --- > if (fgets(line, BUFSIZ, stdin) == NULL) > return; 177a187 > clrbuf(line); Park, Hyeon Je KAIST, Seoul, Korea (UUCP: ...!hplabs!kaist!hjpark)