Server changing variables randomly (memory bug?)
#9

Quote:
Originally Posted by SecretBoss
View Post
Buffer overflow means that your string has more cells than it can hold for example

Code:
CMD:test(playerid)
{	
	new message[100];
	if(sscanf(params, "s[144]", message)) return 0;
	
	new string[100];
	format(string, sizeof(string), "%s from id %i", message, playerid);
	SendClientMessage(playerid, -1, string);
	return 1;
}
I remember facing such problems but the server never crashed

I hope my info helped you out
Sscanf automatically discards the excess hence the warning (afaik)? I don't think we're even meant to have only "s[144]", am I wrong?

Quote:
Originally Posted by PawnHunter
View Post
I got a problem similar to this once, I defined a global string and after some time the string changes to random characters but never fixed it, had to re-create the whole thing I made..
Very similar, if not, the same issue.

Quote:
Originally Posted by Golimad
View Post
Did you run your server on localhost to check if it does the same thing?
Not yet, because it happens after a few hours.
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 2 Guest(s)