login
Header Space

 
 

Re: gets() messed up ?

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
Date: Wednesday, February 3, 1993 - 4:32 pm

rob@cad4.lbl.gov (Robert J. McNamara) writes:

It doesn't make a difference.  The gets function is broken as designed
(as somebody recently put it in comp.std.c).  

The message you got is (I believe) only a warning: the programs works
but you get noted that it can be unreliable.

--
Lars.Wirzenius@helsinki.fi  (finger wirzeniu@klaava.helsinki.fi)
   MS-DOS, you can't live with it, you can live without it.

PS.  Oh, you wanted to know _why_ gets is unreliable?  That's because
it cannot know how big an array it is reading into, and can therefore
easily go past its end if the input line is too long.  (An example of
what using gets can mean is the Internet Worm.)  Further discussion
about this to mail, please, since it has absolutely nothing to do with
Linux and while it would belong to comp.lang.c, this question has been
discussed to death several times already.
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: gets() messed up ?, Lars Wirzenius, (Wed Feb 3, 4:32 pm)
speck-geostationary