--- parser3/src/main/pa_string.C 2019/12/05 22:59:45 1.262 +++ parser3/src/main/pa_string.C 2020/10/14 16:51:46 1.264 @@ -12,7 +12,7 @@ #include "pa_charset.h" #include "pa_vregex.h" -volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.262 2019/12/05 22:59:45 moko Exp $" IDENT_PA_STRING_H; +volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.264 2020/10/14 16:51:46 moko Exp $" IDENT_PA_STRING_H; const String String::Empty; @@ -86,14 +86,20 @@ template inline T pa_ato_any } unsigned int pa_atoui(const char *str, int base, const String* problem_source){ + if(!str) + return 0; + return pa_ato_any(str, base, problem_source, UINT_MAX); } unsigned long long pa_atoul(const char *str, int base, const String* problem_source){ + if(!str) + return 0; + return pa_ato_any(str, base, problem_source, ULLONG_MAX); } -int pa_atoi(const char* str, const String* problem_source) { +int pa_atoi(const char* str, int base, const String* problem_source) { if(!str) return 0; @@ -111,7 +117,7 @@ int pa_atoi(const char* str, const Strin str++; } - unsigned int result=pa_atoui(str, 0, problem_source); + unsigned int result=pa_atoui(str, base, problem_source); if(negative && result <= ((unsigned int)(-(1+INT_MIN)))+1) return -(int)result;