@@ -3,20 +3,21 @@ #include #include #include /* We only handle base 10. */ -unsigned long long int strtoull(char *nptr, char **endptr, int base) { +unsigned long long int strtoull(const char *nptr, char **endptr, int base) { unsigned long long int retval = 0; + const char **endptrd = (const char **) endptr; char *idx = NULL; for (idx = nptr; *idx != '\0' && isdigit(*idx); idx++) { retval *= 10; retval += (*idx - '0'); } - if (endptr != NULL) { - *endptr = idx; + if (endptrd != NULL) { + *endptrd = idx; } return(retval); }