Artifact a2ea6970d971f2825e8a9343a4f640b0668abf07:
- File strtoull.c — part of check-in [58c3554ca1] at 2004-10-29 03:10:28 on branch trunk — Fixed some warnings. libconfig 0.0.8 (user: rkeene, size: 482) [annotate] [blame] [check-ins using]
#include <sys/types.h> #include <stdlib.h> #include <limits.h> #include <ctype.h> #include <stdio.h> /* We only handle base 10. */ 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 (endptrd != NULL) { *endptrd = idx; } return(retval); }