summaryrefslogtreecommitdiff
path: root/lib/libc/gdtoa/gdtoa.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/gdtoa/gdtoa.c')
-rw-r--r--lib/libc/gdtoa/gdtoa.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libc/gdtoa/gdtoa.c b/lib/libc/gdtoa/gdtoa.c
index 8ff8cc587ea..3b642508fe9 100644
--- a/lib/libc/gdtoa/gdtoa.c
+++ b/lib/libc/gdtoa/gdtoa.c
@@ -417,11 +417,9 @@ gdtoa
if (dval(d) > ds + dval(eps))
goto bump_up;
else if (dval(d) < ds - dval(eps)) {
- while(*--s == '0'){}
- s++;
if (dval(d))
inex = STRTOG_Inexlo;
- goto ret1;
+ goto clear_trailing0;
}
break;
}
@@ -479,8 +477,12 @@ gdtoa
}
++*s++;
}
- else
+ else {
inex = STRTOG_Inexlo;
+ clear_trailing0:
+ while(*--s == '0'){}
+ ++s;
+ }
break;
}
}
@@ -738,7 +740,7 @@ gdtoa
if (b->wds > 1 || b->x[0])
inex = STRTOG_Inexlo;
while(*--s == '0'){}
- s++;
+ ++s;
}
ret:
Bfree(S);