HELP ME :[
#2

As shown in ******' sscanf tutorial/thread, he explains these kind of errors.

"sscanf warning: String buffer overflow.

This error comes up when people try and put too much data in to a string. For example:

pawn Код:
new str[10];
sscanf("Hello there, how are you?", "s[10]", str);
That code will try and put the string "Hello there, how are you?" in to the variable called "str". However, "str" is only 10 cells big and can thus only hold the string "Hello ther" (with a NULL terminator). In this case, the rest of the data is ignored - which could be good or bad:

pawn Код:
new str[10], num;
sscanf("Hello there you|42", "p<|>s[10]i", str, num);
In this case "num" is still correctly set to "42", but the warning is given for lost data ("e you").

Currently there is nothing you can do about this from a programming side (you can't even detect it - that is a problem I intend to address), as long as you specify how much data a user should enter this will simply discard the excess, or make the destination variable large enough to handle all cases."

https://sampforum.blast.hk/showthread.php?tid=120356

EDIT: If this doesn't work for you, make sure you're using the latest version of sscanf.
Replace
pawn Код:
#include <sscanf>
with
pawn Код:
#include <sscanf2>
after updating.
Reply


Messages In This Thread
HELP ME :[ - by Ozas.. - 16.01.2013, 17:44
Re: HELP ME :[ - by Threshold - 16.01.2013, 17:47
Re: HELP ME :[ - by Ozas.. - 16.01.2013, 17:49
Re: HELP ME :[ - by Konstantinos - 16.01.2013, 18:06
Re: HELP ME :[ - by Ozas.. - 16.01.2013, 18:15
Re: HELP ME :[ - by Konstantinos - 16.01.2013, 18:18

Forum Jump:


Users browsing this thread: 1 Guest(s)