On 01-Feb-98, Neil Heller wrote to Anthony Tibbs about C++ SAVEDING STUFF.
AT>> char s[40]; fgets (s, 40, stdin); printf ("\n\nThis was the
AT>> string you entered: %s\n", s);
NH> That will STILL give a case of the nasties if the user enters 40
NH> characters. You must make room for the terminating null.
Nope, fgets is made so you pass directly sizeof (buffer) as the size.
Javier Kohen >jkohen@tough.com< [The_Crusher] http://jkohen.base.org
+4:900/748.3+ _200:201/126_ ICQ:#3855350# PGPID:*3423EAA9*
.!. You don't want money, you don't want a diamond ring. You say you want my
.!. lovin' more than any other thing * Ramones
--- Terminate 5.00/Pro
---------------
* Origin: The King of The Ring (4:900/748.3)
|