--- parser3/src/main/pa_string.C 2023/12/13 20:07:11 1.271 +++ parser3/src/main/pa_string.C 2024/09/24 00:18:54 1.274 @@ -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.271 2023/12/13 20:07:11 moko Exp $" IDENT_PA_STRING_H; +volatile const char * IDENT_PA_STRING_C="$Id: pa_string.C,v 1.274 2024/09/24 00:18:54 moko Exp $" IDENT_PA_STRING_H; const String String::Empty; @@ -46,9 +46,10 @@ template inline T pa_ato_any } } - if (base < 2 || base > 16) { /* illegal base */ + if (base < 2 || base > 16) /* illegal base */ throw Exception(PARSER_RUNTIME, 0, "base to must be an integer from 2 to 16"); - } + if (*pos == '-') + throw Exception("number.format", problem_source, problem_source ? "out of range (negative)" : "'%s' is out if range (negative)", str); T cutoff = max / base; int cutoff_digit = (int)(max - cutoff * base); @@ -80,7 +81,7 @@ template inline T pa_ato_any while(char c=*pos++) if(!isspace(c)) - throw Exception("number.format", problem_source, problem_source ? "invalid number (int)" : "'%s' is invalid number (int)", str); + throw Exception("number.format", problem_source, problem_source ? "invalid number (int)" : "'%s' is an invalid number (int)", str); return result; } @@ -188,7 +189,7 @@ typedef struct { static int CORD_range_contains_chr_greater_then_proc(char c, size_t size, void* client_data) { - register chr_data * d = (chr_data *)client_data; + chr_data * d = (chr_data *)client_data; if (d -> countdown<=0) return(2); d -> countdown -= size; @@ -232,7 +233,7 @@ public: *this+=new String("match"); *this+=new String("postmatch"); for(int i=0; i