sscanf console error
#1

The following error occurs in the server console window. It compiles fine, with no warnings (except the obvious "unused symbols" that are there for future purposes).
Quote:

sscanf warning: Strings without a legnth are deprecated, please add a destination size

I see no space for a size parameter, so I'm confused:

Код:
command(login, playerid, params[])
{
	if(gPlayerLogged[playerid] == 0)
	{
		new name[MAX_PLAYER_NAME];
		new file[MAX_PLAYER_NAME+5];	// player name + file extension + 2 for luck.
		new password[120];
		new tmp[120];

		format(file, sizeof(file), "%s.ini", name);
		if(sscanf(params, "s", password))
		{
		  SendClientMessage(playerid, COLOR_USAGE, "Usage: \"/login [password]\"");
		}
Reply
#2

pawn Код:
if(sscanf(params, "s[128]", password)) //The string need so have a size
{
SendClientMessage(playerid, COLOR_USAGE, "Usage: \"/login [password]\"");
}
Reply
#3

Ahh thanks. Makes sense, I guess. But I figured it would take the size of the destination var
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)