]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/platform-bionic.git/blobdiff - libc/upstream-openbsd/lib/libc/stdio/vfwprintf.c
Merge "Fix nan output in the printf family."
[android-sdk/platform-bionic.git] / libc / upstream-openbsd / lib / libc / stdio / vfwprintf.c
index 745b4d93f5ee1ac36f200e659a497fe924859dd7..a6f41232c53bbc9059ef1df1c409d60d18d44122 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: vfwprintf.c,v 1.10 2014/05/03 12:36:45 deraadt 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.
@@ -324,9 +324,6 @@ __vfwprintf(FILE * __restrict fp, const wchar_t * __restrict fmt0, __va_list ap)
        int realsz;             /* field size expanded by dprec */
        int size;               /* size of converted field or string */
        const char *xdigs;      /* digits for %[xX] conversion */
-#define NIOV 8
-       struct __suio uio;      /* output information: summary */
-       struct __siov iov[NIOV];/* ... and individual io vectors */
        wchar_t buf[BUF];       /* buffer with space for digits of uintmax_t */
        wchar_t ox[2];          /* space for 0x; ox[1] is either x, X, or \0 */
        union arg *argtable;    /* args, built due to positional arg */
@@ -463,9 +460,6 @@ __vfwprintf(FILE * __restrict fp, const wchar_t * __restrict fmt0, __va_list ap)
        argtable = NULL;
        nextarg = 1;
        va_copy(orgap, ap);
-       uio.uio_iov = iov;
-       uio.uio_resid = 0;
-       uio.uio_iovcnt = 0;
        ret = 0;
        convbuf = NULL;
 
@@ -737,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;