summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib/ecvt.c
diff options
context:
space:
mode:
authormartynas <>2009-10-16 12:15:03 +0000
committermartynas <>2009-10-16 12:15:03 +0000
commitc60cc3534a1017f18ae4f304bae4d32410563a2b (patch)
tree59d1cec7b9ac419c47f1a14672ac023d3f11f83a /src/lib/libc/stdlib/ecvt.c
parent657f1f4d482640f182b87aff96649878a773d94c (diff)
downloadopenbsd-c60cc3534a1017f18ae4f304bae4d32410563a2b.tar.gz
openbsd-c60cc3534a1017f18ae4f304bae4d32410563a2b.tar.bz2
openbsd-c60cc3534a1017f18ae4f304bae4d32410563a2b.zip
teach gdtoa & its subroutines that malloc can fail; in which case
ecvt, fcvt, gcvt, *printf, strtof, strtod, strtold act per ieee 1003.1. after these massive changes, remove unused files which would not work now. reported by Maksymilian Arciemowicz; ok theo
Diffstat (limited to 'src/lib/libc/stdlib/ecvt.c')
-rw-r--r--src/lib/libc/stdlib/ecvt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libc/stdlib/ecvt.c b/src/lib/libc/stdlib/ecvt.c
index 719370a8f3..03ff918967 100644
--- a/src/lib/libc/stdlib/ecvt.c
+++ b/src/lib/libc/stdlib/ecvt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ecvt.c,v 1.6 2006/10/29 18:45:56 deraadt Exp $ */ 1/* $OpenBSD: ecvt.c,v 1.7 2009/10/16 12:15:03 martynas Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2002, 2006 Todd C. Miller <Todd.Miller@courtesan.com> 4 * Copyright (c) 2002, 2006 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -62,6 +62,8 @@ __cvt(double value, int ndigit, int *decpt, int *sign, int fmode, int pad)
62 *rve = '\0'; 62 *rve = '\0';
63 } else { 63 } else {
64 p = __dtoa(value, fmode + 2, ndigit, decpt, sign, &rve); 64 p = __dtoa(value, fmode + 2, ndigit, decpt, sign, &rve);
65 if (p == NULL)
66 return (NULL);
65 if (*decpt == 9999) { 67 if (*decpt == 9999) {
66 /* Infinity or Nan, convert to inf or nan like printf */ 68 /* Infinity or Nan, convert to inf or nan like printf */
67 *decpt = 0; 69 *decpt = 0;