Why are you using strtol when your result is being cast to an unsigned char?
Is it because you need the base conversion? You can use the code I posted
earlier by substituting the number base for 16.
Regards,
Steve
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 02, 2000 4:22 PM
To: Palm Developer Forum
Subject: Re: strtol function
I'm trying to emulate the stdlib c function strtol, as in:
long strtol(const char *s, char **endptr, int base)
To be used like this:
/* Get the checksum on the first digits */
for(i=0;i<len-2;i+=3) {
checkSum += (unsigned char)strtol(&code[i], NULL, 16);
}
Steve
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html