Constant Warning...
#1

Hey, so I decided to try an update the SQL plugin..

But keeps spamming me with this warning

Код:
warning 224: indeterminate array size in "sizeof" expres sion (symbol "max_len")
Код:
ValidateLogin(playerid, inputtext[]) {
	query[0] = 0;//[256];
	mysql_escape_string(inputtext, inputtext);
	if(GetPVarInt(playerid, "SecurePass")) {
		format(query, sizeof(query),"");
	} else {
		format(query, sizeof(query),"");
	}
	mysql_function_query(g_mysql_handle, query, true, "OnLoginAttempt", "d", playerid);
}
case EAccountDialog_EnterPassword: {
			if(!response) {
				SendClientMessage(playerid, X11_RED2, "Incorrect answer, try again.");
				SetTimerEx("TimedKick",1000, false, "d",playerid);
			} else {
				ValidateLogin(playerid, inputtext);
			}
		}
Anyone have ANY clue how to fix this..
Reply
#2

Well guess what, query[0] is giving you this warning. Set a proper size.
Reply
#3

Nope. You're using sizeof on inputtext, and that's a bad thing.
pawn Код:
mysql_escape_string(inputtext, inputtext);
https://sampwiki.blast.hk/wiki/MySQL/R33..._escape_string 4th argument

Either create a new string, or pass strlen as 4th argument of that function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)