int nThree = 0;char *cThree = "3";nThree = atoi(cThree);
unsigned long int _strtoul(LIBDEF_ConstStringPtr nptr, LIBDEF_StringPtr *endptr, int base, unsigned int len)
it enters this loop of the previously mentioned function:
if (base < 37) { while (CheckCharWithBase(*nptr, base, &val)) { CHECK_OVERFLOW(lsum, >, (ULONG_MAX - val) / base, ERANGE); lsum = lsum * base + val; ++nptr; if (--len == 0) { goto done; /*lint !e801 Use of goto is not deprecated */ } } /* end while */ }
The value for "lsum" is 0, "base" here is 10, "val" is 3, and nptr is pointing to the ascii character "3". When it does the check overflow, it ends up in another file RTSHC08.c in this block of code, and it does not proceed past the last line here.
static void _ENTER_BINARY_L(void) { asm { _PUSH_REGS PSHX ; // @i PSHH#ifdef __HCS08__ LDHX 6,SP ; // ra PSHX PSHH
The command window provides this error:
Error: Attempt to push or pop with SP out of allowed range
Please note that I am not really used to C, and I have spent much more time in VB.Net, Java, and C#. I need to be able to parse integer strings before I can proceed to terminal commands. Thanks for the help.