Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libc/gdtoa Fix some bugs [exceed array bounds]. Simplify.
details: https://anonhg.NetBSD.org/src/rev/dab715e0f382
branches: trunk
changeset: 766742:dab715e0f382
user: matt <matt%NetBSD.org@localhost>
date: Fri Jul 01 03:20:06 2011 +0000
description:
Fix some bugs [exceed array bounds]. Simplify.
diffstat:
lib/libc/gdtoa/strtof_vaxf.c | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diffs (41 lines):
diff -r 37d449c8426b -r dab715e0f382 lib/libc/gdtoa/strtof_vaxf.c
--- a/lib/libc/gdtoa/strtof_vaxf.c Fri Jul 01 03:09:29 2011 +0000
+++ b/lib/libc/gdtoa/strtof_vaxf.c Fri Jul 01 03:20:06 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: strtof_vaxf.c,v 1.5 2008/03/28 00:56:54 he Exp $ */
+/* $NetBSD: strtof_vaxf.c,v 1.6 2011/07/01 03:20:06 matt Exp $ */
/****************************************************************
@@ -56,14 +56,13 @@
k = strtodg(s, sp, &fpi, &expt, bits);
if (k == STRTOG_NoMemory) {
errno = ERANGE;
- u.L[0] = Big0;
- u.L[1] = Big1;
- return u.f;
+ return HUGE_VALF;
}
switch(k & STRTOG_Retmask) {
case STRTOG_NoNumber:
case STRTOG_Zero:
- u.L[0] = 0;
+ default:
+ u.f = 0.0;
break;
case STRTOG_Normal:
@@ -73,11 +72,11 @@
break;
case STRTOG_Infinite:
- u.L[0] = 0xffff7fff;
+ u.f = HUGE_VALF;
break;
}
if (k & STRTOG_Neg)
u.L[0] |= 0x00008000L;
return u.f;
- }
+}
Home |
Main Index |
Thread Index |
Old Index