MySQL - sscanf overflow.
#1

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?
Reply
#2

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.
Reply
#3

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!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)