summaryrefslogtreecommitdiff
path: root/libio/iowpadn.c
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2012-11-16 19:13:11 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2012-11-16 19:13:11 +0530
commit2b766585f9b4ffabeef2f36200c275976b93f2c7 (patch)
treed6be89abc6bfa88e5e9fd997bb4cfd94b035adc2 /libio/iowpadn.c
parentb1848fdeec705bc7d2f64e3a365f1ff66eeb4f0d (diff)
printf should return negative value on error
[BZ #11741] Fixed bug where printf and family may return a spurious success when printing padded formats.
Diffstat (limited to 'libio/iowpadn.c')
-rw-r--r--libio/iowpadn.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libio/iowpadn.c b/libio/iowpadn.c
index 05632d5bf0..56e4b8ccb2 100644
--- a/libio/iowpadn.c
+++ b/libio/iowpadn.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1993, 1997, 1999 Free Software Foundation, Inc.
+/* Copyright (C) 1993-2012 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -65,7 +65,7 @@ _IO_wpadn (fp, pad, count)
w = _IO_sputn (fp, (char *) padptr, PADSIZE);
written += w;
if (w != PADSIZE)
- return written;
+ return w == EOF ? w : written;
}
if (i > 0)