Path: utzoo!utgpu!watmath!clyde!mcdchg!chinet!les From: les@chinet.chi.il.us (Leslie Mikesell) Newsgroups: comp.lang.c Subject: Re: retiring gets(3) Message-ID: <6928@chinet.chi.il.us> Date: 11 Nov 88 04:23:38 GMT References: <8847@smoke.BRL.MIL> <9054@ihlpb.ATT.COM> Reply-To: les@chinet.chi.il.us (Leslie Mikesell) Organization: Chinet - Public Access Unix Lines: 15 In article <9054@ihlpb.ATT.COM> gregg@ihlpb.ATT.COM (Wonderly) writes: >I believe that the right thing to do is to use a new function called >nlfgets (str, size, fp), that does exactly as gets(3). >.... I have written this exact function many times just to >have the benefit of no strchr() call. Same here, but I made it return the number of characters read so that it can also avoid the strlen() call (which will be incorrect anyway if there were any nulls in the line). Why does any function return a pointer that you obviously already knew? Seems like it would only be useful if you wanted to nest function calls and ignore errors. Les Mikesell