From owner-svn-src-head@freebsd.org Mon Feb 15 22:19:25 2016 Return-Path: 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 79167AA99C9; Mon, 15 Feb 2016 22:19:25 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-yk0-f177.google.com (mail-yk0-f177.google.com [209.85.160.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 44B701A35; Mon, 15 Feb 2016 22:19:24 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-yk0-f177.google.com with SMTP id z13so65766336ykd.0; Mon, 15 Feb 2016 14:19:24 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=KShgPuV9V8amBdmrw5cicJ9J+lokWZJ8GFj57KyG7RI=; b=aBbbY7gyqlkcCDbh6AOdHuaKx9JUhzH/Di/WWmlUMH8eM5iyKvQrmF3fm0k9bq5/JT 9jz8lCqeZURXlxsKRTODU7sZQu7JRMJLtdFoisYqYNqPVbyn4TDy4IWnobbhvlrQjQGz sJECu83B7dAUwgNDXLDDpd+tPKwssfa1XIsi1FvyN9xDJI1+C+NPCoCkj/ieoiw7kgWL y3qQmG42ezpoy/vY4DpPeOmBsq08oA+tjPn0siJQ/MuddtaXUhfEL4Oqv0UC7yWpJDTP 3x59sq2RCxyWHdFo/sUsZ0ybZ8+aY4stV4MjGs1ztxAB1ZkkSBj5tNkzvigNqxz0zTae +bbw== X-Gm-Message-State: AG10YORpXw8Y93VTtOk6Hii0AvVuusSid+5fHCVZ71nylTyPiwEukWvhRKrMJjlaiVGNTw== X-Received: by 10.37.92.6 with SMTP id q6mr1502963ybb.107.1455561150488; Mon, 15 Feb 2016 10:32:30 -0800 (PST) Received: from mail-yw0-f175.google.com (mail-yw0-f175.google.com. [209.85.161.175]) by smtp.gmail.com with ESMTPSA id 204sm21384209ywr.32.2016.02.15.10.32.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 15 Feb 2016 10:32:30 -0800 (PST) Received: by mail-yw0-f175.google.com with SMTP id e63so26060680ywc.3; Mon, 15 Feb 2016 10:32:29 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.129.31.67 with SMTP id f64mr9789193ywf.94.1455561149919; Mon, 15 Feb 2016 10:32:29 -0800 (PST) Reply-To: cem@FreeBSD.org Received: by 10.37.4.23 with HTTP; Mon, 15 Feb 2016 10:32:29 -0800 (PST) In-Reply-To: <201602151813.u1FIDXAt067326@repo.freebsd.org> References: <201602151813.u1FIDXAt067326@repo.freebsd.org> Date: Mon, 15 Feb 2016 10:32:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r295631 - head/lib/libc/stdio From: Conrad Meyer To: "Pedro F. Giffuni" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Feb 2016 22:19:25 -0000 On Mon, Feb 15, 2016 at 10:13 AM, Pedro F. Giffuni wrote: > Author: pfg > Date: Mon Feb 15 18:13:33 2016 > New Revision: 295631 > URL: https://svnweb.freebsd.org/changeset/base/295631 > ... > Note that this implementation convention cannot be adhered to for strings > longer than {INT_MAX} bytes as the value would not be representable in the > return type of the function. For backwards-compatibility, implementations > can return the number of bytes for strings of up to {INT_MAX} bytes, and > return {INT_MAX} for all longer strings. > ... > --- head/lib/libc/stdio/fputs.c Mon Feb 15 17:14:10 2016 (r295630) > +++ head/lib/libc/stdio/fputs.c Mon Feb 15 18:13:33 2016 (r295631) > ... > @@ -62,5 +63,7 @@ fputs(const char * __restrict s, FILE * > ORIENT(fp, -1); > retval = __sfvwrite(fp, &uio); > FUNLOCKFILE(fp); > + if (retval == 0) > + return (iov.iov_len > INT_MAX ? INT_MAX : uio.uio_resid); ^^^^^^^^^^^ why not uio.uio_resid here as well? > return (retval); > } Best, Conrad