]> sourceware.org Git - glibc.git/commitdiff
* stdio-common/vfprintf.c (_IO_helper_overflow): In case _IO_sputn cvs/fedora-glibc-20080716T0944
authorUlrich Drepper <drepper@redhat.com>
Tue, 15 Jul 2008 18:13:22 +0000 (18:13 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 15 Jul 2008 18:13:22 +0000 (18:13 +0000)
doesn't manage to write anything, fail.

ChangeLog
stdio-common/vfprintf.c

index 45c79fdedb93470e0700ab58feeeae957d2216de..15b1c5284fb8d880ae468f01d1fb096a230e1e24 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-07-15  Ulrich Drepper  <drepper@redhat.com>
 
+       * stdio-common/vfprintf.c (_IO_helper_overflow): In case _IO_sputn
+       doesn't manage to write anything, fail.
+
        * malloc/hooks.c (__malloc_check_init): Remove printf.
 
 2008-07-14  Samuel Thibault  <samuel.thibault@ens-lyon.org>
index ca6343c37fdb1777d658458d8ab55a0fd12a1d65..78a1c77d8a553b505171d0233db237bcb6b6c8c1 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007
+/* Copyright (C) 1991-2002, 2003, 2004, 2005, 2006, 2007, 2008
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -2080,6 +2080,8 @@ _IO_helper_overflow (_IO_FILE *s, int c)
     {
       _IO_size_t written = _IO_sputn (target, s->_wide_data->_IO_write_base,
                                      used);
+      if (written == 0)
+       return WEOF;
       s->_wide_data->_IO_write_ptr -= written;
     }
 #else
@@ -2087,6 +2089,8 @@ _IO_helper_overflow (_IO_FILE *s, int c)
   if (used)
     {
       _IO_size_t written = _IO_sputn (target, s->_IO_write_base, used);
+      if (written == 0)
+       return EOF;
       s->_IO_write_ptr -= written;
     }
 #endif
This page took 0.046432 seconds and 5 git commands to generate.