Changed the order.
This commit is contained in:
parent
7139535062
commit
be5f61fad3
@ -51,13 +51,13 @@ int main(void) {
|
||||
for(a = str.data; a = strpbrk(a, "-0123456789\n"); ) {
|
||||
if(*a == '\n') { line++; a++; continue; }
|
||||
if(*a == '-') { anum = a++; continue; }
|
||||
if(!(num = num_array_new(&nums))) goto catch;
|
||||
if(!anum || anum != a - 1) anum = a; /* Wasn't negative. */
|
||||
big_num = strtol(anum, &a, 0);
|
||||
if((!big_num || big_num == LONG_MIN || big_num == LONG_MAX) && errno)
|
||||
goto catch; /* Long conversion failed, (not all platforms.) */
|
||||
if(big_num < INT_MIN || big_num > INT_MAX)
|
||||
{ errno = ERANGE; goto catch; }
|
||||
if(!(num = num_array_new(&nums))) goto catch;
|
||||
num->line = line;
|
||||
num->num = (int)big_num;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user