SA-MP Forums Archive
sscanf warning: Strings without a length are deprecated, please add a destination size. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: sscanf warning: Strings without a length are deprecated, please add a destination size. (/showthread.php?tid=514798)



sscanf warning: Strings without a length are deprecated, please add a destination size. - Blackazur - 23.05.2014

Can a server crash if you get this warning in your server log?


Re: sscanf warning: Strings without a length are deprecated, please add a destination size. - SilentSoul - 23.05.2014

You get this error because your string without a length you used
pawn Код:
new reason[24];
if(sscanf(params, "s",reason))...//empty string cell
You should use instead:
pawn Код:
new reason[24];
if(sscanf(params, "s[24]",reason)) ...



Re : sscanf warning: Strings without a length are deprecated, please add a destination size. - S4t3K - 23.05.2014

No, your server won't crash or anything, but you should really use the string size as SilentSould has mentionned above.


Re: sscanf warning: Strings without a length are deprecated, please add a destination size. - PrivatioBoni - 23.05.2014

To add on something which hasn't been said: If you do not do what SilentSoul demonstrated, your strings will be majorly truncated so it's really for your own interest.