From owner-svn-src-all@freebsd.org Sun Nov 15 20:05:17 2020 Return-Path: Delivered-To: svn-src-all@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 00CDE467747 for ; Sun, 15 Nov 2020 20:05:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-qv1-xf35.google.com (mail-qv1-xf35.google.com [IPv6:2607:f8b0:4864:20::f35]) (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 4CZ38r62mdz3NvV for ; Sun, 15 Nov 2020 20:05:16 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: by mail-qv1-xf35.google.com with SMTP id a15so5506903qvk.5 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=YwjEGrLSzdtD69ECwaHXRTk4O5iOikBUIas0WYSS5bea1dTND8pihf4S5JTLrDSUUJ i74aPx8urHhED23g4BbxFpZb3o4L+blpiBEUIzQNRwxCZimQVKNIgS05A2TtwsBNhQrs AbqfyqKmAos0gjK8MTTGr4tOlyOoj83tr2JR8UrA7igNq8XkN3DX3vhMLt4MR4n2ALzP l2RN31TIUKhUFVtIrD8gc89IibGOkTDH8ANSIccYuWzcRBBzwwuW1R1nAEZTPezdf1YC ePY9XM/+Gzp3i/3oUh851NOuoNNRI2P8YdMrdPQaxsp9tbARp6XWDo8BCzxbz4l6WcYg 3z9g== X-Gm-Message-State: AOAM533a2Jerxr15euprILUBYg7jcgAo/mRLYThDZNvw2pSqItqhANJP 1DGF//jPo+N46P5bRiZBUA0z8le7yNpkSHSzK5CgbfKyqjLZ6xuz 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: 4CZ38r62mdz3NvV 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-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" 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