OSDN Git Service

2003-02-05 Jonathan Larmour <jifl@eCosCentric.com>
authorjjohnstn <jjohnstn>
Wed, 5 Feb 2003 16:52:34 +0000 (16:52 +0000)
committerjjohnstn <jjohnstn>
Wed, 5 Feb 2003 16:52:34 +0000 (16:52 +0000)
    * 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/ChangeLog
newlib/libc/stdio/asprintf.c
newlib/libc/stdio/sprintf.c
newlib/libc/stdio/vasprintf.c
newlib/libc/stdio/vsprintf.c

index 7ec7bca..30338d9 100644 (file)
@@ -1,3 +1,12 @@
+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.
+
 2003-02-03  Jeff Johnston  <jjohnstn@redhat.com>
 
        * libc/stdlib/ldtoa.c (_ldtoa_r): Fix code to allocate the format
index d367815..85bdd31 100644 (file)
@@ -47,6 +47,7 @@ _asprintf_r (ptr, strp, fmt, va_alist)
   f._bf._base = f._p = NULL;
   f._bf._size = f._w = 0;
   f._data = ptr;
+  f._file = -1;  /* No file. */
 #ifdef _HAVE_STDC
   va_start (ap, fmt);
 #else
@@ -80,6 +81,7 @@ asprintf (strp, fmt, va_alist)
   f._bf._base = f._p = NULL;
   f._bf._size = f._w = 0;
   f._data = _REENT;
+  f._file = -1;  /* No file. */
 #ifdef _HAVE_STDC
   va_start (ap, fmt);
 #else
index 879b480..8582272 100644 (file)
@@ -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
index 7f35752..fbfedee 100644 (file)
@@ -46,6 +46,7 @@ _DEFUN (vasprintf, (strp, fmt, ap),
   f._bf._base = f._p = NULL;
   f._bf._size = f._w = 0;
   f._data = _REENT;
+  f._file = -1;  /* No file. */
   ret = vfprintf (&f, fmt, ap);
   *f._p = 0;
   *strp = f._bf._base;
@@ -66,6 +67,7 @@ _DEFUN (_vasprintf_r, (ptr, strp, fmt, ap),
   f._bf._base = f._p = NULL;
   f._bf._size = f._w = 0;
   f._data = ptr;
+  f._file = -1;  /* No file. */
   ret = _vfprintf_r (ptr, &f, fmt, ap);
   *f._p = 0;
   *strp = f._bf._base;
index b440ac5..3b92f26 100644 (file)
@@ -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;