diff options
author | 2014-12-21 00:23:30 +0000 | |
---|---|---|
committer | 2014-12-21 00:23:30 +0000 | |
commit | 8d454a834862155c237f8b7ea9cfe5a63661978d (patch) | |
tree | 5c3bd07ea1da0dd9d86c7e86bef9a47e4843af84 /lib/libc/stdio/vfwprintf.c | |
parent | Fix build with -Werror -std=c99 -pedantic. (diff) | |
download | wireguard-openbsd-8d454a834862155c237f8b7ea9cfe5a63661978d.tar.xz wireguard-openbsd-8d454a834862155c237f8b7ea9cfe5a63661978d.zip |
Show the sign for NaN as per POSIX; from Elliott Hughes.
ok martynas@, millert@, doug@
Diffstat (limited to 'lib/libc/stdio/vfwprintf.c')
-rw-r--r-- | lib/libc/stdio/vfwprintf.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/libc/stdio/vfwprintf.c b/lib/libc/stdio/vfwprintf.c index ef0ca43b91f..a6f41232c53 100644 --- a/lib/libc/stdio/vfwprintf.c +++ b/lib/libc/stdio/vfwprintf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vfwprintf.c,v 1.11 2014/06/04 07:45:25 stsp Exp $ */ +/* $OpenBSD: vfwprintf.c,v 1.12 2014/12/21 00:23:30 daniel Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. * All rights reserved. @@ -731,10 +731,9 @@ fp_common: if (signflag) sign = '-'; if (expt == INT_MAX) { /* inf or nan */ - if (*cp == 'N') { + if (*cp == 'N') cp = (ch >= 'a') ? L"nan" : L"NAN"; - sign = '\0'; - } else + else cp = (ch >= 'a') ? L"inf" : L"INF"; size = 3; flags &= ~ZEROPAD; |