Path: utzoo!attcan!uunet!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: What's so bad about scanf anyway??? Message-ID: <14432@smoke.brl.mil> Date: 12 Nov 90 13:24:27 GMT References: <16582@netcom.UUCP> <4300@sactoh0.SAC.CA.US> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 10 In article <4300@sactoh0.SAC.CA.US> jak@sactoh0.SAC.CA.US (Jay A. Konigsberg) writes: >IMHO gets() or getchar() is better for input because the programmer >has greater control over what is being input. Specifically, if the >programmer wants a float value and a character is input gets() won't >error on it, scanf() will. My argument goes mainly to bullet-proofing >programs. If you really are concerned about bulletproofing, don't use gets() unless you have control over the length of the lines being scanned. Use fgets() instead, if the input comes from some uncontrolled source (like a human).