Module Name:    src
Committed By:   matt
Date:           Fri Jul  1 03:20:06 UTC 2011

Modified Files:
        src/lib/libc/gdtoa: strtof_vaxf.c

Log Message:
Fix some bugs [exceed array bounds].  Simplify.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libc/gdtoa/strtof_vaxf.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/gdtoa/strtof_vaxf.c
diff -u src/lib/libc/gdtoa/strtof_vaxf.c:1.5 src/lib/libc/gdtoa/strtof_vaxf.c:1.6
--- src/lib/libc/gdtoa/strtof_vaxf.c:1.5	Fri Mar 28 00:56:54 2008
+++ src/lib/libc/gdtoa/strtof_vaxf.c	Fri Jul  1 03:20:06 2011
@@ -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;
-	}
+}

Reply via email to