Path: utzoo!attcan!uunet!ncrlnk!ncrcae!hubcap!gatech!ncar!mailrus!iuvax!bsu-cs!dhesi From: dhesi@bsu-cs.UUCP (Rahul Dhesi) Newsgroups: comp.lang.c Subject: Re: retiring gets(3) Message-ID: <4768@bsu-cs.UUCP> Date: 15 Nov 88 16:12:23 GMT References: <1988Nov14.220842.3980@utstat.uucp> Reply-To: dhesi@bsu-cs.UUCP (Rahul Dhesi) Organization: CS Dept, Ball St U, Muncie, Indiana Lines: 16 In article <1988Nov14.220842.3980@utstat.uucp> geoff@utstat.uucp (Geoff Collyer) writes: >gets is >probably unique among C library functions because it cannot be used >safely, no matter how hard you wish or how hard you work. Well, now, suppose we (a) write lines of known length to a file that is not writable by anybody else, (b) open that file for input and make it our standard input and (c) use gets with a buffer that is known to be big enough to hold any line in that file. Thus gets is probably unique among C library functions because it can be used safely if you try hard enough, but it should not be used anyway, because most practical uses of it are not safe. -- Rahul Dhesi UUCP: !{iuvax,pur-ee}!bsu-cs!dhesi