SA-MP Forums Archive
MySQL - sscanf overflow. - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL - sscanf overflow. (/showthread.php?tid=260229)



MySQL - sscanf overflow. - shitbird - 07.06.2011

Hi.
I've got this MySQL script, and I'm having some problems with it.
As soon as I enter /login password, it prints "sscanf string overflow." into the server console. It does however authenticate it, but doesn't load any stats.

I understood that it's because it's somehow receiving more information than it is actually set to receive. I don't know why though, this is basically it:

pawn Код:
new
        values[5];

    sscanf(Query, "p<|>{s[24]s[129]s[16]}a<i>[5]", values); // s[24] = Playername. [s129] whirlpool pass s[16] IP, and <i> [5] = listed under this.

    gPlayerInfo[playerid][pAdmin]  = values[0];

    GivePlayerMoney(playerid, values[1]);
    SetPlayerScore(playerid, values[2]);
   
    gPlayerInfo[playerid][pLevel] = values[3];
    gPlayerInfo[playerid][pPoints] = values[4];

    gPlayerInfo[playerid][pLoggedIn] = true;
   
    SendClientMessage(playerid, COLOR_GREEN, "** [INFO] You have succesfully authenticated. Your stats have been loaded.");
    PlayerPlaySound(playerid, 1056, playerid, playerid, playerid);
I have a global array on top of the script (Query), which is 1024cells long.
Why is my script doing this?


Re: MySQL - sscanf overflow. - Scenario - 07.06.2011

I had a similar problem earlier this week and Calg00ne was able to help me. I am using BlueG's MySQL plugin and before using sscanf, I forgot "mysql_fetch_row_format()". You may need to use "mysql_fetch_row()" for Strickenkid's.


Re: MySQL - sscanf overflow. - shitbird - 07.06.2011

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I had a similar problem earlier this week and Calg00ne was able to help me. I am using BlueG's MySQL plugin and before using sscanf, I forgot "mysql_fetch_row_format()". You may need to use "mysql_fetch_row()" for Strickenkid's.
Oh, you're such a babe.
That's all that was needed.
Thanks!