mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Portability fixes
This commit is contained in:
parent
6c4b8d3499
commit
894e8fca6e
6 changed files with 38 additions and 21 deletions
|
|
@ -196,15 +196,15 @@ longlong my_strtoll10(const char *nptr, char **endptr, int *error)
|
|||
goto overflow;
|
||||
|
||||
/* Check that we didn't get an overflow with the last digit */
|
||||
if (i > cutoff || i == cutoff && (j > cutoff2 || j == cutoff2 &&
|
||||
k > cutoff3))
|
||||
if (i > cutoff || (i == cutoff && ((j > cutoff2 || j == cutoff2) &&
|
||||
k > cutoff3)))
|
||||
goto overflow;
|
||||
li=i*LFACTOR2+ (ulonglong) j*100 + k;
|
||||
return (longlong) li;
|
||||
|
||||
overflow: /* *endptr is set here */
|
||||
*error= MY_ERRNO_ERANGE;
|
||||
return negative ? LONGLONG_MIN : ULONGLONG_MAX;
|
||||
return negative ? LONGLONG_MIN : (longlong) ULONGLONG_MAX;
|
||||
|
||||
end_i:
|
||||
*endptr= (char*) s;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue