aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/stdio/sprintf.c
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2003-02-05 16:52:34 +0000
committerJeff Johnston <jjohnstn@redhat.com>2003-02-05 16:52:34 +0000
commit5017a3dafa5d01d47b74872600524f1559973c26 (patch)
tree9281de60735df2908b21edb6b93033082f2e70f8 /newlib/libc/stdio/sprintf.c
parentb7f52fe81a955e16b0bd7944354755cf14924798 (diff)
downloadnewlib-5017a3dafa5d01d47b74872600524f1559973c26.zip
newlib-5017a3dafa5d01d47b74872600524f1559973c26.tar.gz
newlib-5017a3dafa5d01d47b74872600524f1559973c26.tar.bz2
2003-02-05 Jonathan Larmour <jifl@eCosCentric.com>
* 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.
Diffstat (limited to 'newlib/libc/stdio/sprintf.c')
-rw-r--r--newlib/libc/stdio/sprintf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/newlib/libc/stdio/sprintf.c b/newlib/libc/stdio/sprintf.c
index 879b480..8582272 100644
--- a/newlib/libc/stdio/sprintf.c
+++ b/newlib/libc/stdio/sprintf.c
@@ -325,6 +325,7 @@ _sprintf_r (ptr, str, fmt, va_alist)
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._w = INT_MAX;
f._data = ptr;
+ f._file = -1; /* No file. */
#ifdef _HAVE_STDC
va_start (ap, fmt);
#else
@@ -356,6 +357,7 @@ sprintf (str, fmt, va_alist)
f._bf._base = f._p = (unsigned char *) str;
f._bf._size = f._w = INT_MAX;
f._data = _REENT;
+ f._file = -1; /* No file. */
#ifdef _HAVE_STDC
va_start (ap, fmt);
#else