retiring gets(3)

Rob Bernardo rob at pbhyf.PacBell.COM
Fri Nov 25 06:39:48 AEST 1988


In article <225800095 at uxe.cso.uiuc.edu> mcdonald at uxe.cso.uiuc.edu writes:
+>I suspect that I am far from the only one who would be most
+>interested in learning to use gets(3) safely.
+I don't understand how you can get something like
+    gets(3);
+past a compiler. Isn't 'gets' supposed to take a char * argument,
+not an int literal?

You win the Gracie Allen Award of C!

Reminds me of something that happened in code walkthrough. One of the reviewers
noticed that all the exit statements were:
	exit(2);
and asked the programmer why an exit value of two was used regardless of
the exit conditions. The programmer replied, "That's what it says on
the top of the man page."


-- 
Rob Bernardo, Pacific Bell UNIX/C Reusable Code Library
Email:     ...![backbone]!pacbell!pbhyf!rob   OR  rob at pbhyf.PacBell.COM
Office:    (415) 823-2417  Room 4E750A, San Ramon Valley Administrative Center
Residence: (415) 827-4301  R Bar JB, Concord, California



More information about the Comp.lang.c mailing list