diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-10-05 19:52:35 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2008-10-05 19:52:35 +0000 |
commit | 19ee7fe9c3cfc9f5c71dadfdaa8d4154d03b018d (patch) | |
tree | 268471986b11d832193aceaa553ec89a56a8a025 /lib | |
parent | 0842054b803e45a45ccb28cd60e4bb1c1ac1e1c6 (diff) |
Fix conversion of numbers without an exponent.
ok martynas@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/locale/wcstod.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libc/locale/wcstod.c b/lib/libc/locale/wcstod.c index c9879314a1a..22467f0eb68 100644 --- a/lib/libc/locale/wcstod.c +++ b/lib/libc/locale/wcstod.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wcstod.c,v 1.1 2005/07/01 08:59:27 espie Exp $ */ +/* $OpenBSD: wcstod.c,v 1.2 2008/10/05 19:52:34 kettenis Exp $ */ /* $NetBSD: wcstod.c,v 1.4 2001/10/28 12:08:43 yamt Exp $ */ /*- @@ -55,7 +55,7 @@ wcstod(const wchar_t *nptr, wchar_t **endptr) /* get length of string */ start = src; - if (wcschr(L"+-", *src)) + if (*src && wcschr(L"+-", *src)) src++; size = wcsspn(src, L"0123456789"); src += size; @@ -64,9 +64,9 @@ wcstod(const wchar_t *nptr, wchar_t **endptr) size = wcsspn(src, L"0123456789"); src += size; } - if (wcschr(L"Ee", *src)) { + if (*src && wcschr(L"Ee", *src)) { src++; - if (wcschr(L"+-", *src)) + if (*src && wcschr(L"+-", *src)) src++; size = wcsspn(src, L"0123456789"); src += size; |