diff options
author | dim <dim@FreeBSD.org> | 2016-02-21 13:49:26 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-02-21 13:49:26 +0000 |
commit | 2e1a0cbbd8f5a5ca7ec73c85311451ed1ac4242c (patch) | |
tree | bb5f550a5fd2ee1357495987f5076839273e5998 /lib/libc/stdio/fputs.c | |
parent | f393760a8a7c87242739a64002290b7bda94cb27 (diff) | |
parent | 579b7ad49fdbcb4dd1e016603c5d0774b32c12d1 (diff) | |
download | FreeBSD-src-2e1a0cbbd8f5a5ca7ec73c85311451ed1ac4242c.zip FreeBSD-src-2e1a0cbbd8f5a5ca7ec73c85311451ed1ac4242c.tar.gz |
Merge ^/head r295601 through r295844.
Diffstat (limited to 'lib/libc/stdio/fputs.c')
-rw-r--r-- | lib/libc/stdio/fputs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libc/stdio/fputs.c b/lib/libc/stdio/fputs.c index 32e5764..1f9795a 100644 --- a/lib/libc/stdio/fputs.c +++ b/lib/libc/stdio/fputs.c @@ -37,6 +37,7 @@ static char sccsid[] = "@(#)fputs.c 8.1 (Berkeley) 6/4/93"; __FBSDID("$FreeBSD$"); #include "namespace.h" +#include <limits.h> #include <stdio.h> #include <string.h> #include "un-namespace.h" @@ -62,5 +63,7 @@ fputs(const char * __restrict s, FILE * __restrict fp) ORIENT(fp, -1); retval = __sfvwrite(fp, &uio); FUNLOCKFILE(fp); + if (retval == 0) + return (iov.iov_len > INT_MAX ? INT_MAX : iov.iov_len); return (retval); } |