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=550752)



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

Help , how to fix?

Console: sscanf warning: Strings without a length are deprecated, please add a destination size.

Command: /ogetip

Code:
Код:
CMD:ogetip(playerid,params[])
{
	if(pInfo[playerid][pAdmin] == 0) return 0;

	new name2[24],msg[250];
 	if(sscanf(params, "s", name2))
		return SendClientMessage(playerid, COLOR_RED, "[Server]: Use: /ogetip < Full Name >");

    format(ipFILE, 64, "AKAIP/Users/Aliases/%s.txt", name2);

    if(!dini_Exists(ipFILE))
        return SendClientMessage(playerid, COLOR_GREY, "[Server]: This name can not be found!");

 	format(msg,sizeof(msg),"[Server] Check: IP: %s | Player: %s", name2, dini_Get("AKAIP/Users/Aliases/ips.txt",name2) );
	return SendClientMessage(playerid,COLOR_GREY,msg);

}



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

It's here:
Код:
if(sscanf(params, "s", name2))
You need to add the size of the string.
Код:
if(sscanf(params, "s[23]", name2))



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

thanks! dominik