Stack/heap collision (insufficient stack size)
#1

Triggering this:

Код:
CMD:loadpass(playerid)
{
new query[120],pName[MAX_PLAYER_NAME],string[124];
GetPlayerName(playerid,pName,sizeof(pName));
format(query, sizeof(query), "SELECT * FROM `users` WHERE `Username` = '%s'", pName);
mysql_query(query);
mysql_store_result();
new field[58][120],row[128];
mysql_fetch_row_format(row, "|");
explode(row, field, "|");
mysql_free_result();
PlayerInfo[playerid][pPass] = strval(field[3]);
format(string,sizeof(string),"%d",PlayerInfo[playerid][pPass]); SendClientMessage(playerid,-1,string);
return 1;
}
Keeps showing me this in the console:

Код:
[debug] Run time error 3: "Stack/heap collision (insufficient stack size)"
[debug]  Stack pointer (STK) is 0x1B063EC, heap pointer (HEA) is 0x1B096B8
[debug] AMX backtrace:
[debug] #0 00000000 in public cmd_loadpass () from maintest.amx
[debug] #1 native CallLocalFunction () from samp-server.exe
[debug] #2 00000000 in public OnPlayerCommandText () from maintest.amx
Any suggestions that might help? Much appreciated.
Reply
#2

Yes, I suggest you not invade player's privacy.
Reply
#3

The password is getting hashed upon registration. Maybe you didn't notice that it's a number, not a string.

Anyway, I fixed the problem, just used #pragma to increase the space
Reply
#4

Pretty certain using #pragma for anything is bad practice, i'm not 100% sure, which ones or are not bad practice but maybe Vince could explain better on that.

I never had to use #pragma for anything.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)