The Dink Network

sprintf

August 15th 2005, 05:40 PM
pillbug.gif
Drink
Peasant He/Him Chile
Don't drink 
In this line...

sprintf(crap, "%s", spr[h].text);

..."crap" will have the value of "spr[h].text" or not??
If not, then what this line do?
August 15th 2005, 07:43 PM
wizardb.gif
merlin
Peasant He/Him
 
Yep. sprintf is very dangerous since it leaves potential for a buffer overflow. Either be very careful while using it or use snprintf, which sadly, isn't portable.
August 15th 2005, 09:37 PM
pillbug.gif
Drink
Peasant He/Him Chile
Don't drink 
Thank you Merlin