summaryrefslogtreecommitdiff
path: root/stdio-common/vfprintf.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2008-07-16 09:53:45 +0000
committerJakub Jelinek <jakub@redhat.com>2008-07-16 09:53:45 +0000
commitc83494a925f4b4b716f9ba3abcb5e695d3e2a8a9 (patch)
treed47fb1fa79c201c98e2fa7bb8dfeb6ed582beef0 /stdio-common/vfprintf.c
parent1cb6b555a864f401c8a2ba75814e982b66a62971 (diff)
Updated to fedora-glibc-20080716T0944cvs/fedora-glibc-2_8_90-9
Diffstat (limited to 'stdio-common/vfprintf.c')
-rw-r--r--stdio-common/vfprintf.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index ca6343c37f..714c76c3d4 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,11 @@ _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 || written == WEOF)
+ return WEOF;
+ __wmemmove (s->_wide_data->_IO_write_base,
+ s->_wide_data->_IO_write_base + written,
+ used - written);
s->_wide_data->_IO_write_ptr -= written;
}
#else
@@ -2087,6 +2092,10 @@ _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 || written == EOF)
+ return EOF;
+ memmove (s->_IO_write_base, s->_IO_write_base + written,
+ used - written);
s->_IO_write_ptr -= written;
}
#endif