summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/fputs.c
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2014-07-25 03:24:00 +0000
committerpfg <pfg@FreeBSD.org>2014-07-25 03:24:00 +0000
commit414a4cb93173e7abba9c0ff6950044c5254370d1 (patch)
tree662d996ede51e7070e29e2e5c6704042e3c1c92e /lib/libc/stdio/fputs.c
parent103bd6e167d38f5a8626fd51ccfcba53cd614e94 (diff)
downloadFreeBSD-src-414a4cb93173e7abba9c0ff6950044c5254370d1.zip
FreeBSD-src-414a4cb93173e7abba9c0ff6950044c5254370d1.tar.gz
MFC r268985, r269001:
Avoid possible cast degradation. Assign iov_len first, avoiding the cast to uio_resid (int in stdio) from degrading the value. Small cosmetical fix while here.
Diffstat (limited to 'lib/libc/stdio/fputs.c')
-rw-r--r--lib/libc/stdio/fputs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libc/stdio/fputs.c b/lib/libc/stdio/fputs.c
index 3b8f2c9..32e5764 100644
--- a/lib/libc/stdio/fputs.c
+++ b/lib/libc/stdio/fputs.c
@@ -55,7 +55,7 @@ fputs(const char * __restrict s, FILE * __restrict fp)
struct __siov iov;
iov.iov_base = (void *)s;
- iov.iov_len = uio.uio_resid = strlen(s);
+ uio.uio_resid = iov.iov_len = strlen(s);
uio.uio_iov = &iov;
uio.uio_iovcnt = 1;
FLOCKFILE(fp);
OpenPOWER on IntegriCloud