TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: MANISH MALIK
from: ANTHONY TIBBS
date: 1998-02-02 19:02:00
subject: C++ Saveding stuff

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);
^^^^^^^^^^^^^^^^^^^^^^
That's the problem.
fgets (s, 40, stdin);
Use that.  It'll only take the first (40-1) characters.
--- PointEd 2.0
---------------
* Origin: The Tibbs' Point - Ottawa, Ontario, Canada (1:163/215.38)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.