Well, one thing that stands out is that if the pattern "," does not appear,
you read past the end of the allocated block.  Are you blowing up inside the
for loop?

-jjf

-----Original Message-----
From: Ralph Krausse [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 22, 2000 6:51 AM
To: Palm Developer Forum
Subject: Wrong code shown....


Opps. this was the code.....

Word CListObject::_GetLastPos(CharPtr pszRecord)
{
        VoidHand vHandle = MemHandleNew(StrLen(pszRecord) + 1);
        CharPtr pNextChar  = (CharPtr)MemHandleLock(vHandle);
        StrCopy(pNextChar,pszRecord);

        int     wTotalCount     = 0;
        for(;*pNextChar;pNextChar++)
        {
                if(*pNextChar == '\"'  && *(pNextChar + 1) == ',' &&
*(pNextChar + 2) == '\"')
                {
                        break;
                }
                wTotalCount++;
        } 

        MemHandleUnlock(vHandle);
        MemHandleFree(vHandle);
        return wTotalCount;
}

-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/tech/support/forums/

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to