Similar changes like in strtol, all this family is VERY broken
in 8bit environment (isalpha at the end of digits)
This commit is contained in:
parent
eb26b35651
commit
e7241b8ffe
@ -56,7 +56,7 @@ strtoq(nptr, endptr, base)
|
||||
{
|
||||
register const char *s;
|
||||
register u_quad_t acc;
|
||||
register int c;
|
||||
register unsigned char c;
|
||||
register u_quad_t qbase, cutoff;
|
||||
register int neg, any, cutlim;
|
||||
|
||||
@ -109,6 +109,8 @@ strtoq(nptr, endptr, base)
|
||||
cutlim = cutoff % qbase;
|
||||
cutoff /= qbase;
|
||||
for (acc = 0, any = 0;; c = *s++) {
|
||||
if (!isascii(c))
|
||||
break;
|
||||
if (isdigit(c))
|
||||
c -= '0';
|
||||
else if (isalpha(c))
|
||||
|
@ -56,7 +56,7 @@ strtoq(nptr, endptr, base)
|
||||
{
|
||||
register const char *s;
|
||||
register u_quad_t acc;
|
||||
register int c;
|
||||
register unsigned char c;
|
||||
register u_quad_t qbase, cutoff;
|
||||
register int neg, any, cutlim;
|
||||
|
||||
@ -109,6 +109,8 @@ strtoq(nptr, endptr, base)
|
||||
cutlim = cutoff % qbase;
|
||||
cutoff /= qbase;
|
||||
for (acc = 0, any = 0;; c = *s++) {
|
||||
if (!isascii(c))
|
||||
break;
|
||||
if (isdigit(c))
|
||||
c -= '0';
|
||||
else if (isalpha(c))
|
||||
|
@ -54,7 +54,7 @@ strtoul(nptr, endptr, base)
|
||||
{
|
||||
register const char *s = nptr;
|
||||
register unsigned long acc;
|
||||
register int c;
|
||||
register unsigned char c;
|
||||
register unsigned long cutoff;
|
||||
register int neg = 0, any, cutlim;
|
||||
|
||||
@ -80,6 +80,8 @@ strtoul(nptr, endptr, base)
|
||||
cutoff = (unsigned long)ULONG_MAX / (unsigned long)base;
|
||||
cutlim = (unsigned long)ULONG_MAX % (unsigned long)base;
|
||||
for (acc = 0, any = 0;; c = *s++) {
|
||||
if (!isascii(c))
|
||||
break;
|
||||
if (isdigit(c))
|
||||
c -= '0';
|
||||
else if (isalpha(c))
|
||||
|
@ -56,7 +56,7 @@ strtouq(nptr, endptr, base)
|
||||
{
|
||||
register const char *s = nptr;
|
||||
register u_quad_t acc;
|
||||
register int c;
|
||||
register unsigned char c;
|
||||
register u_quad_t qbase, cutoff;
|
||||
register int neg, any, cutlim;
|
||||
|
||||
@ -87,6 +87,8 @@ strtouq(nptr, endptr, base)
|
||||
cutoff = (u_quad_t)UQUAD_MAX / qbase;
|
||||
cutlim = (u_quad_t)UQUAD_MAX % qbase;
|
||||
for (acc = 0, any = 0;; c = *s++) {
|
||||
if (!isascii(c))
|
||||
break;
|
||||
if (isdigit(c))
|
||||
c -= '0';
|
||||
else if (isalpha(c))
|
||||
|
@ -56,7 +56,7 @@ strtouq(nptr, endptr, base)
|
||||
{
|
||||
register const char *s = nptr;
|
||||
register u_quad_t acc;
|
||||
register int c;
|
||||
register unsigned char c;
|
||||
register u_quad_t qbase, cutoff;
|
||||
register int neg, any, cutlim;
|
||||
|
||||
@ -87,6 +87,8 @@ strtouq(nptr, endptr, base)
|
||||
cutoff = (u_quad_t)UQUAD_MAX / qbase;
|
||||
cutlim = (u_quad_t)UQUAD_MAX % qbase;
|
||||
for (acc = 0, any = 0;; c = *s++) {
|
||||
if (!isascii(c))
|
||||
break;
|
||||
if (isdigit(c))
|
||||
c -= '0';
|
||||
else if (isalpha(c))
|
||||
|
Loading…
Reference in New Issue
Block a user