sscanf: String buffer overflow
#1

Well my command is not working right I am sure I am missing something really basic but I just cant see what.

Quote:

{
new PID, reason[35], pName[MAX_PLAYER_NAME], Sender[MAX_PLAYER_NAME];
if(sscanf(params, "us", PID, reason)) return SendClientMessage(playerid, 0xFF0000FF, "Usage: /PM [playerid/partofname] [message]");
if(!IsPlayerConnected(PID)) return SendClientMessage(playerid, 0xFF0000FF, "That user is not connected!");
else
{
new Str[256];
GetPlayerName(PID, pName, sizeof(pName));
GetPlayerName(playerid, Sender, sizeof(Sender));
format(Str, sizeof(Str), "(( PM From: %s(%d): %s ))", Sender, playerid, reason);
SendClientMessage(PID, 0xF6C861AA, Str);
format(Str, sizeof(Str), "(( PM Sent To: %s(%d): %s ))", pName, PID, reason);
SendClientMessage(playerid, 0xF6C861AA, Str);
}
return 1;
}

What is wrong with this?
It says in the server log:

[07:59:41] sscanf warning: Strings without a length are deprecated, please add a destination size.
[07:59:41] sscanf warning: String buffer overflow.
Reply


Messages In This Thread
sscanf: String buffer overflow - by Kurtis96z - 04.06.2012, 11:54
Re: sscanf: String buffer overflow - by Kurtis96z - 04.06.2012, 12:08
Re: sscanf: String buffer overflow - by Kurtis96z - 04.06.2012, 12:21

Forum Jump:


Users browsing this thread: 1 Guest(s)