aboutsummaryrefslogtreecommitdiff
path: root/libio/iopadn.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/iopadn.c
parentb1848fdeec705bc7d2f64e3a365f1ff66eeb4f0d (diff)
downloadglibc-2b766585f9b4ffabeef2f36200c275976b93f2c7.zip
glibc-2b766585f9b4ffabeef2f36200c275976b93f2c7.tar.gz
glibc-2b766585f9b4ffabeef2f36200c275976b93f2c7.tar.bz2
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/iopadn.c')
-rw-r--r--libio/iopadn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libio/iopadn.c b/libio/iopadn.c
index 7e37450..b7a4c5a 100644
--- a/libio/iopadn.c
+++ b/libio/iopadn.c
@@ -59,7 +59,7 @@ _IO_padn (fp, pad, count)
w = _IO_sputn (fp, padptr, PADSIZE);
written += w;
if (w != PADSIZE)
- return written;
+ return w == EOF ? w : written;
}
if (i > 0)