From 607bced4fa031f2dbd13539133b0971e2034c49e Mon Sep 17 00:00:00 2001 From: pfg Date: Tue, 22 Jul 2014 23:29:54 +0000 Subject: Avoid possible cast degradation. For consistency with r268985 for fputs.c, assign iov_len first, avoiding the cast to uio_resid (int in stdio) from degrading the value. We currently don't support lengths higher than INT_MAX so this change is little more than cosmetic. MFC after: 3 days --- lib/libc/stdio/putw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/libc/stdio/putw.c') diff --git a/lib/libc/stdio/putw.c b/lib/libc/stdio/putw.c index 0360caf..ecd5d095 100644 --- a/lib/libc/stdio/putw.c +++ b/lib/libc/stdio/putw.c @@ -50,7 +50,7 @@ putw(int w, FILE *fp) struct __siov iov; iov.iov_base = &w; - iov.iov_len = uio.uio_resid = sizeof(w); + uio.uio_resid = iov.iov_len = sizeof(w); uio.uio_iov = &iov; uio.uio_iovcnt = 1; FLOCKFILE(fp); -- cgit v1.1