From owner-svn-src-head@freebsd.org Sun Nov 15 20:05:17 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 00F96467749 for ; Sun, 15 Nov 2020 20:05:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CZ38r65JCz3Nh7 for ; Sun, 15 Nov 2020 20:05:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf2c.google.com with SMTP id 63so7667766qva.7 for ; Sun, 15 Nov 2020 12:05:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cNSIKxL7yT34XdthCJBQ4npO/ZnnJDBQ2xZQiyQ1rjw=; b=w0SgQfry+MM2FfDwK8RaTwMgfTmbWpFfdFk+PfA/8QGUSJ65CjF092OjiTk5gj23IX xUcEDZeKnvCLH3x38Ms/OA8D03DoXiIQIclBl7JkqASY85o3oPujDj1QiYSvzvBCfegv cQ3cNumoyTOzbUrCwBZyzoMItJDcBcJWumtJ4dHD8YA3ZZAKlerppcl3FRojDkAKDONy n17xO/BP681g+N3Uz9TPdh5LdIFA1z50/4Oq/5B3maUP6EZoBYTsyMou1BYzmCOnfISH 5Ck6aEeaJ1J2tTunBJvZBR+RmQriN5rgi/Af8nCv5xB3QYomCnT8TGxOZtlcLxlBq6mq qmgg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cNSIKxL7yT34XdthCJBQ4npO/ZnnJDBQ2xZQiyQ1rjw=; b=TxUYB7/+VxmVsnU1q8w1kpbUD7QiRES/XJbz35xAcE4oe3Y86EdhWjfC6zTJJqs/1S Im/UkmSQhDq+BsFoxD7vWfpq/opB2kRik21RT/riyB3iL8oT4ySy/ji0D55yCUKzO5/t y5SudhujfXj+AnuZi1Hi/WryWAePCtmgDcqSVww6yXq3a9FJfnrhuxgCEsCI6mTPvsTA ykFUF0u+/HZg7ovwAbMxm4zjvhDD2KMgYY+6bAL4eOCoh27ZbNdPdEsYi2bfCggwIIua +0qiwtMNCIbDYH34WqSomNQNIsTuvK4v9MUvo78UFmFU56ziMTAkJEtuRLapENyEP5Jx uTYA== X-Gm-Message-State: AOAM533pEQ9Y/zT4pKl+3O3/UXaEaDU5aTIXV9IY7BCJ8Zi15JRQa6eo kee42+AbjXciNh7da9NLAAt5CUk51Gs68UPsHulOIA== X-Google-Smtp-Source: ABdhPJwLVveo8ieAQDFiBc0MYwot9uGEDSRFxpujVJNILPgJc6LGd87BNe6iQfMYISMv7vw+uBmDGUnIiy7rtvxtJXw= X-Received: by 2002:ad4:4e13:: with SMTP id dl19mr11995588qvb.24.1605470715551; Sun, 15 Nov 2020 12:05:15 -0800 (PST) MIME-Version: 1.0 References: <202011150748.0AF7mqW3016900@repo.freebsd.org> In-Reply-To: From: Warner Losh Date: Sun, 15 Nov 2020 13:05:04 -0700 Message-ID: Subject: Re: svn commit: r367701 - head/lib/libutil To: Scott Long Cc: Jessica Clarke , Scott Long , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4CZ38r65JCz3Nh7 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 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: Sun, 15 Nov 2020 20:05:17 -0000 Hey Scott, On Sun, Nov 15, 2020 at 11:46 AM Scott Long wrote: > The man page for strlcpy() made reference to the return value being > equivalent to what snprintf() does. The man page for snprintf() states > that negatve return values are possible, so I assumed the same was > true for strlcpy(). However, now that I=E2=80=99ve looked at the impleme= ntation > of strlcpy(), I see that you=E2=80=99re correct. The man pages are defin= itely > confusing, and this isn=E2=80=99t the only place where I think there=E2= =80=99s > inconsistency in the documentation, or at least poor wording choices. Yea, it says both that it will never return a negative value (since size_t is never negative) and that it returns the same things as snprintf (which is true... except for that detail which it glosses over in return type differences). So this issue doesn't get lost, I've added a clarification to the examples in https://reviews.freebsd.org/D27228 . Please take a look and let me know what you think. If more extensive edits are needed, there's full context so you can at least flag those in the review as well. I've read these too many times to see the other places you're talking about, so a fresh set of eyes would be helpful. Warner