Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Feb 2016 10:32:29 -0800
From:      Conrad Meyer <cem@FreeBSD.org>
To:        "Pedro F. Giffuni" <pfg@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r295631 - head/lib/libc/stdio
Message-ID:  <CAG6CVpWN8Me9bZd-=b%2B_jVW_Wjgnq2X%2BLA-SHvYQezJ6YjxR3g@mail.gmail.com>
In-Reply-To: <201602151813.u1FIDXAt067326@repo.freebsd.org>
References:  <201602151813.u1FIDXAt067326@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Feb 15, 2016 at 10:13 AM, Pedro F. Giffuni <pfg@freebsd.org> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG6CVpWN8Me9bZd-=b%2B_jVW_Wjgnq2X%2BLA-SHvYQezJ6YjxR3g>