08.02.2011, 01:14
I've looked over the code, it matches the database.
I still can't figure out why I'm getting this error.
I still can't figure out why I'm getting this error.
Код:
sscanf warning: String buffer overflow.
pawn Код:
new name[24], arr[9], farr[3], arr2[17], farr2[2];
if(!sscanf(result, "s[23]a<i>[9]a<f>[3]a<i>[17]a<f>[2]", name, arr, farr, arr2, farr2))
{
printf(result);
strmid(PlayerInfo[playerid][pUsername], name, 0, strlen(name), 255);
PlayerInfo[playerid][pSQLid] = arr[0];
PlayerInfo[playerid][pPassword] = arr[1];
PlayerInfo[playerid][pLevel] = arr[2];
PlayerInfo[playerid][pAdmin] = arr[3];
PlayerInfo[playerid][pCash] = arr[4];
PlayerInfo[playerid][pBank] = arr[5];
PlayerInfo[playerid][pSkin] = arr[6];
PlayerInfo[playerid][pSex] = arr[7];
PlayerInfo[playerid][pAge] = arr[8];
PlayerInfo[playerid][pPos_x] = farr[0];
PlayerInfo[playerid][pPos_y] = farr[1];
PlayerInfo[playerid][pPos_z] = farr[2];
PlayerInfo[playerid][pInt] = arr2[0];
PlayerInfo[playerid][pFaction] = arr2[1];
PlayerInfo[playerid][pRank] = arr2[2];
PlayerInfo[playerid][pMask] = arr2[3];
PlayerInfo[playerid][pPhone] = arr2[4];
PlayerInfo[playerid][pMuted] = arr2[5];
PlayerInfo[playerid][pWarns] = arr2[6];
PlayerInfo[playerid][pPayday] = arr2[7];
PlayerInfo[playerid][pInBiz] = arr2[8];
PlayerInfo[playerid][pInHouse] = arr2[9];
PlayerInfo[playerid][pDuty] = arr2[10];
PlayerInfo[playerid][pDutySkin] = arr2[11];
PlayerInfo[playerid][pCuffed] = arr2[12];
PlayerInfo[playerid][pCuffTime] = arr2[13];
PlayerInfo[playerid][pJailed] = arr2[14];
PlayerInfo[playerid][pJailTime] = arr2[15];
PlayerInfo[playerid][pJob] = arr2[16];
PlayerInfo[playerid][pHealth] = farr2[0];
PlayerInfo[playerid][pArmour] = farr2[1];
mysql_free_result();
}