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:
Andrey A. Chernov 1995-08-01 22:04:57 +00:00
parent eb26b35651
commit e7241b8ffe
5 changed files with 15 additions and 5 deletions

View File

@ -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))

View File

@ -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))

View File

@ -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))

View File

@ -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))

View File

@ -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))