retiring gets(3)
Wayne Mesard
mesard at bbn.com
Sun Nov 13 04:47:44 AEST 1988
>From article <9054 at ihlpb.ATT.COM>, by gregg at ihlpb.ATT.COM (Wonderly):
> The biggest
> concern that most people have about moving from gets to fgets is the
> added hassle of doing a
>
> if ((t = strchr (buf, '\n')) != NULL)
> *t = 0;
>
> This seems to be a lot of work when you may be processing thousands of
> lines of code.
Or have this new function return a pointer to the _last_ char read,
instead of redundantly returning its first param. This would require
exactly no extra work on the part of the library routine or the client
program.
--
void *Wayne_Mesard(); MESARD at BBN.COM BBN, Cambridge, MA
More information about the Comp.lang.c
mailing list