From owner-svn-src-head@freebsd.org  Mon Feb 15 21:18:53 2016
Return-Path: <owner-svn-src-head@freebsd.org>
Delivered-To: svn-src-head@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id CA669AA9C1D;
 Mon, 15 Feb 2016 21:18:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from repo.freebsd.org (repo.freebsd.org
 [IPv6:2610:1c1:1:6068::e6a:0])
 (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
 (Client did not present a certificate)
 by mx1.freebsd.org (Postfix) with ESMTPS id 9C2C917C6;
 Mon, 15 Feb 2016 21:18:53 +0000 (UTC) (envelope-from pfg@FreeBSD.org)
Received: from repo.freebsd.org ([127.0.1.37])
 by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u1FLIqlQ023192;
 Mon, 15 Feb 2016 21:18:52 GMT (envelope-from pfg@FreeBSD.org)
Received: (from pfg@localhost)
 by repo.freebsd.org (8.15.2/8.15.2/Submit) id u1FLIq5U023191;
 Mon, 15 Feb 2016 21:18:52 GMT (envelope-from pfg@FreeBSD.org)
Message-Id: <201602152118.u1FLIq5U023191@repo.freebsd.org>
X-Authentication-Warning: repo.freebsd.org: pfg set sender to pfg@FreeBSD.org
 using -f
From: "Pedro F. Giffuni" <pfg@FreeBSD.org>
Date: Mon, 15 Feb 2016 21:18:52 +0000 (UTC)
To: src-committers@freebsd.org, svn-src-all@freebsd.org,
 svn-src-head@freebsd.org
Subject: svn commit: r295638 - head/lib/libc/stdio
X-SVN-Group: head
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-BeenThere: svn-src-head@freebsd.org
X-Mailman-Version: 2.1.20
Precedence: list
List-Id: SVN commit messages for the src tree for head/-current
 <svn-src-head.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/svn-src-head/>
List-Post: <mailto:svn-src-head@freebsd.org>
List-Help: <mailto:svn-src-head-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-head>,
 <mailto:svn-src-head-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Mon, 15 Feb 2016 21:18:53 -0000

Author: pfg
Date: Mon Feb 15 21:18:52 2016
New Revision: 295638
URL: https://svnweb.freebsd.org/changeset/base/295638

Log:
  fputs: Return the number of bytes written.
  
  Fix r295631: wrong value.
  
  Pointy hat:	pfg (me)
  Pointed out by:	bde

Modified:
  head/lib/libc/stdio/fputs.c

Modified: head/lib/libc/stdio/fputs.c
==============================================================================
--- head/lib/libc/stdio/fputs.c	Mon Feb 15 20:27:16 2016	(r295637)
+++ head/lib/libc/stdio/fputs.c	Mon Feb 15 21:18:52 2016	(r295638)
@@ -64,6 +64,6 @@ fputs(const char * __restrict s, FILE * 
 	retval = __sfvwrite(fp, &uio);
 	FUNLOCKFILE(fp);
 	if (retval == 0)
-		return (iov.iov_len > INT_MAX ? INT_MAX : uio.uio_resid);
+		return (iov.iov_len > INT_MAX ? INT_MAX : iov.iov_len);
 	return (retval);
 }