about summary refs log tree commit diff
path: root/stdio-common
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-07-15 18:13:22 +0000
committerUlrich Drepper <drepper@redhat.com>2008-07-15 18:13:22 +0000
commit2486b4965bc9cad848f2da57fe0ea53f851bd5ad (patch)
tree4eeaf097876dcbf742053202001e6212ec4d90d9 /stdio-common
parent9667f97dd3c6daabfabf43c24601ff6f941902c2 (diff)
downloadglibc-2486b4965bc9cad848f2da57fe0ea53f851bd5ad.tar.gz
glibc-2486b4965bc9cad848f2da57fe0ea53f851bd5ad.tar.xz
glibc-2486b4965bc9cad848f2da57fe0ea53f851bd5ad.zip
* stdio-common/vfprintf.c (_IO_helper_overflow): In case _IO_sputn cvs/fedora-glibc-20080716T0944
	doesn't manage to write anything, fail.
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/vfprintf.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index ca6343c37f..78a1c77d8a 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -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