From 5017a3dafa5d01d47b74872600524f1559973c26 Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Wed, 5 Feb 2003 16:52:34 +0000 Subject: 2003-02-05 Jonathan Larmour * libc/stdio/vsprintf.c (vsprintf, _vsprintf_r): Set _file fd to -1 to be sure it cannot later match a valid file fd causing isatty() to return 1. * libc/stdio/asprintf.c (asprintf, _asprintf_r): Ditto. * libc/stdio/sprintf.c (sprintf, _sprintf_r): Ditto. * libc/stdio/vasprintf.c (vasprintf, _vasprintf_r): Ditto. --- newlib/libc/stdio/vsprintf.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'newlib/libc/stdio/vsprintf.c') diff --git a/newlib/libc/stdio/vsprintf.c b/newlib/libc/stdio/vsprintf.c index b440ac506..3b92f2676 100644 --- a/newlib/libc/stdio/vsprintf.c +++ b/newlib/libc/stdio/vsprintf.c @@ -44,6 +44,7 @@ _DEFUN (vsprintf, (str, fmt, ap), f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = INT_MAX; f._data = _REENT; + f._file = -1; /* No file. */ ret = vfprintf (&f, fmt, ap); *f._p = 0; return ret; @@ -63,6 +64,7 @@ _DEFUN (_vsprintf_r, (ptr, str, fmt, ap), f._bf._base = f._p = (unsigned char *) str; f._bf._size = f._w = INT_MAX; f._data = ptr; + f._file = -1; /* No file. */ ret = _vfprintf_r (ptr, &f, fmt, ap); *f._p = 0; return ret; -- cgit v1.2.3