String.Count[] locking up

A forum for reporting bugs NOT related to custom plugins.

Moderator: MacroQuest Developers

chawk
orc pawn
orc pawn
Posts: 14
Joined: Sat May 08, 2004 4:08 am

String.Count[] locking up

Post by chawk » Sat May 08, 2004 8:02 am

edit: on second thought, I should download Service Pack 6 first then see if this bug still exists :shock:
edit2: still locks up EQ, meh.




Any uses of String.Count[] were locking me up, so I peeked into the source for it.

Code: Select all

	case Count:
		if (Index[0])
		{
			Dest.DWord=0;
			PCHAR pLast=(PCHAR)VarPtr.Ptr;
			/*
			while(pLast=strchr(pLast,Index[0]))
				Dest.DWord++;
			*/
			while(*pLast)
			{
				if (*pLast == Index[0]) Dest.DWord++;
				pLast++;
			}
			Dest.Type=pIntType;
			return true;
		}
		return false;
Commented out the while loop and rewrote it slightly and it compiles fine. I'm assuming, then, the existing code is erroneous somehow, though I can't figure out why that would freeze up. Something with strchr() I guess.

Lax
We're not worthy!
We're not worthy!
Posts: 3524
Joined: Thu Oct 17, 2002 1:01 pm
Location: ISBoxer
Contact:

Post by Lax » Sat May 08, 2004 9:29 am

oops, i know why ;)
Lax Lacks
Master of MQ2 Disaster
Purveyor of premium, EULA-safe MMORPG Multiboxing Software
* Multiboxing with ISBoxer: Quick Start Video
* EQPlayNice, WinEQ 2.0