http://c-faq.com/stdio/scanfprobs.html
On 9/14/06, NAHieu [EMAIL PROTECTED] wrote:
On 9/14/06, G TT [EMAIL PROTECTED] wrote:
Vi` white spaces ddu+o+.c xem nhu+ string terminator, ne^n xem ma~:
#inclue stdio.h
int main()
{
char str[80];
printf(Enter some words (or 'ctrl-c' to break): );
scanf(%s, str); == buffer length unchecked HERE
It is a very *stupid* idea to use scanf() to get input!
fgets() is certainly a better choice in this case.
RTFM!
Cheers,
H
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
VietLUG-users mailing list
VietLUG-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vietlug-users
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642
___
VietLUG-users mailing list
VietLUG-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vietlug-users