Strings overlap eachother.
#1

Hello, I ran into a bug from a really short code but I just can't find what I did wrong.

I'm using myStrcpy to store strings in a variable.
Код:
myStrcpy(to[], const from[])
{
  new length = strlen(from);
  for (new i = 0; i <= length; i++)
  {
    to[i] = from[i];
  }
  return 1;
}
i use a stock to reset the inventory from a player like this:
Код:
stock ResetInventory(playerid)
{
	for(new b=26; b<=53; b++)
	{
		myStrcpy(InventoryInfo[playerid][invtext][b],"None");
		if(b==26) printf("test3: %s",InventoryInfo[playerid][invtext][26]);
		if(b==27) printf("test4: %s",InventoryInfo[playerid][invtext][26]);
		if(b==28) printf("test5: %s",InventoryInfo[playerid][invtext][26]);
	}
	return 1;
}
I already made some prints in that stock which might be usefull to locate the problem for you guys since I cant find the issue.
Код:
test3: None
test4: NNone
test5: NNNone
As you see the string overlap eachother.
Hopefully someone can help me!

Here is the enum for InventoryInfo
Код:
enum inventorystats
{
	invtext[64],
	itemid,
	ammo,
	sort,
}
new InventoryInfo[MAX_PLAYERS][inventorystats][54];
Reply


Messages In This Thread
Strings overlap eachother. - by justinnater - 11.12.2015, 13:39
Re: Strings overlap eachother. - by vassilis - 11.12.2015, 13:42
Re: Strings overlap eachother. - by justinnater - 11.12.2015, 13:44
Re: Strings overlap eachother. - by vassilis - 11.12.2015, 13:48
Re: Strings overlap eachother. - by justinnater - 11.12.2015, 13:55
Re: Strings overlap eachother. - by vassilis - 11.12.2015, 14:28
Re: Strings overlap eachother. - by Vince - 11.12.2015, 14:43
Re: Strings overlap eachother. - by vassilis - 11.12.2015, 14:45
Re: Strings overlap eachother. - by SickAttack - 11.12.2015, 14:52
Re: Strings overlap eachother. - by justinnater - 11.12.2015, 14:53

Forum Jump:


Users browsing this thread: 3 Guest(s)