On Jan 31 22:36, 1998, Manish Malik of 6:606/26 wrote:
G'day Manish,
AT>> NO! Never! Bad! You've allocated 40 bytes,
AT>> but the user could easily type 4000.
MM> okay, hows this piece of code ??
MM> char *s;
MM> gets(s);
MM> puts("\r\n Whether you typed 40 or 4000, I have it all ! Here - ");
MM> puts(s);
MM> Okay now ? :-)
Put out the other hand, what makes you think you will get to puts(s) ? ;-)
s needs to be allocated.
Regards, Frank. Email: fadam@sensation.net.au.
--- Msged 4.20 beta 4
---------------
* Origin: The ticking point, Melbourne, Australia. (3:635/728.21@fidonet)
|