Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!mailrus!ames!haven!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: retiring gets(3) Message-ID: <8915@smoke.BRL.MIL> Date: 18 Nov 88 02:43:30 GMT References: <1988Nov14.220842.3980@utstat.uucp> <8902@smoke.BRL.MIL> <1988Nov16.184238.16375@utzoo.uucp> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 16 In article <1988Nov16.184238.16375@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes: >In article <8902@smoke.BRL.MIL> gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) writes: >>... In fact they're wrong. I routinely use gets() in >>an utterly safe manner... >Well, "utterly safe" if you're always very careful that part A of your >program preserves the length limits that part B is relying on. Personally >I prefer slightly more robust programming, especially when there's no >significant difference in convenience or efficiency. Why work harder when gets() does exactly what one needs? Another safe use is for small "one-shot" test programs etc. that are to be used only by persons and procedures that will not exceed the limits. I've written quite a few of these over the years and they have never had their buffers overrun, because nobody who is in a position to do so (me, usually) has the least interest in doing so.