Path: utzoo!utgpu!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!purdue!haven!ncifcrf!nlm-mcs!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: retiring gets(3) Message-ID: <8847@smoke.BRL.MIL> Date: 10 Nov 88 02:56:58 GMT References: <1988Nov8.054845.23998@utstat.uucp> <1031@cps3xx.UUCP> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 8 In article <1031@cps3xx.UUCP> usenet@cps3xx.UUCP (Usenet file owner) writes: >This may be a naive question, or perhaps I haven't followed the right >stories, but what is the problem with using gets versus fgets? If you don't know for sure that the input line will fit the buffer you've allocated for it, gets() can overrun the buffer (with random consequences). However, if your program can be sure that the line will fit, there is nothing wrong with using gets().