Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libc/gdtoa/strtodnrp.c,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -r1.1 -r1.2 --- src/lib/libc/gdtoa/strtodnrp.c 2006/01/25 15:18:53 1.1 +++ src/lib/libc/gdtoa/strtodnrp.c 2008/03/21 23:13:48 1.2 @@ -1,4 +1,4 @@ -/* $NetBSD: strtodnrp.c,v 1.1 2006/01/25 15:18:53 kleink Exp $ */ +/* $NetBSD: strtodnrp.c,v 1.2 2008/03/21 23:13:48 christos Exp $ */ /**************************************************************** @@ -53,6 +53,12 @@ strtod(CONST char *s, char **sp) union { ULong L[2]; double d; } u; k = strtodg(s, sp, &fpi, &exp, bits); + if (k == STRTOG_NoMemory) { + errno = ERANGE; + u.L[0] = Big0; + u.L[1] = Big1; + return u.d; + } switch(k & STRTOG_Retmask) { case STRTOG_NoNumber: case STRTOG_Zero: