Skip to content

Commit

Permalink
* stdio-common/vfprintf.c (_IO_helper_overflow): In case _IO_sputn
Browse files Browse the repository at this point in the history
	doesn't manage to write anything, fail.
  • Loading branch information
Ulrich Drepper committed Jul 15, 2008
1 parent 9667f97 commit 2486b49
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -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>
Expand Down
6 changes: 5 additions & 1 deletion stdio-common/vfprintf.c
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -2080,13 +2080,17 @@ _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
int used = s->_IO_write_ptr - s->_IO_write_base;
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
Expand Down

0 comments on commit 2486b49

Please sign in to comment.