From nobody Sun Oct 06 11:07:23 2024 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XLzyM6f2Mz5XgCl; Sun, 06 Oct 2024 11:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XLzyM6370z4sJF; Sun, 6 Oct 2024 11:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728212843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SydC2Byda/uCnA3+G2nHWK0oxHWc6KU1A8NzNT39msg=; b=XqxlufCx9heNBWgREoj6BCU+pgXv+a3aXrBQUGxxyKep87DdckzjNriOero60hgpVMgcfC 7yDn8p20ntR0AtRhwN+KzRQ05I07YsScZwtBiEn6b1XrAt65IE6VjDxkfP9VBYhzwLdqw+ XWL0dIUB+5YcFFaYn7+6DMQ6wgHSI/5GOGE0nL9O1v6VfYYL6//t01LoVHtKhs1LaywRn8 ZE2oz94mEk8B1U4mH+zNmhYQDOMfBMaG+cGZpPoM9spVJQGSTKMULOXwh7PSuECtT3kvkX 86mRas6FGJc0nTdTIiCkOg7+keI8f/iI3P7bWMPtvKrNtiu3chdZM0lGhon+/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728212843; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=SydC2Byda/uCnA3+G2nHWK0oxHWc6KU1A8NzNT39msg=; b=WF4rv2bBeXfPLsAF/YxLywWZGWPfyEqcHMteqBcKMFTJGGKHS3wEolQ96c0BjbXU33ZkDt xLzGTI0YKsHlG81fUvdQ03CWQU0FfGj4w0fiRdKR1A/I9KKYS2G3+FzoTmBZ1ZbXV6d6EA HpZSkhMQkG8aX0p4xEI4tj9oyr6CbZckxxQecaOlnlf7wqUlSj0yCUDRr3wmRr7CWMzbWG e8iFDYsg1mHDDvoOw3RTOX98gEdrShvbQB5vxnVaAMZwfjrBUorBzvcqlqn/L6mU5kZE0S wCMxG0t4wzG3BJpnJWyDkzp+ZiWF106JCBvEerhtpMt9dt0QRqsxccdJIXpWeA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728212843; a=rsa-sha256; cv=none; b=idwBF6CoIRdMtTn5+Zv7YnoQgAgZmTljw9jGTUn3HrdPgi6qTuvx+re4TSJbV9L9WqZfhm e85jAtTDslMLxvygGk52/A+VG1HIW2JwuSKV59UCZxFcMmgh7z27OMv2oLx2eb5c4uvrOq xcjke2IB9Goe9U9cSjZTH9+1g9XVr5xEif+UWZr0JhQuigtKDUSeUOb5QuwY74biEKwNe/ IVJu5EXxTXq18yQuR4NGrCSW0bZjjlJyxZiH+Gn2+HqaRCs5JgiSJlc2czwZGtDBBNX/X4 xR2qK6PhOjP/8Jrc+Tc5B+7hspTfDAzhghNmaWgDJEkET3UcM/prtosbogYDpg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XLzyM5dCkz10d5; Sun, 6 Oct 2024 11:07:23 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 496B7N4K039110; Sun, 6 Oct 2024 11:07:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 496B7NGX039107; Sun, 6 Oct 2024 11:07:23 GMT (envelope-from git) Date: Sun, 6 Oct 2024 11:07:23 GMT Message-Id: <202410061107.496B7NGX039107@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: d2c02cfae55a - stable/14 - date: Fix a few nits. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: des X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: d2c02cfae55a1ffb179b55f45a89606845e1acfb Auto-Submitted: auto-generated The branch stable/14 has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=d2c02cfae55a1ffb179b55f45a89606845e1acfb commit d2c02cfae55a1ffb179b55f45a89606845e1acfb Author: Dag-Erling Smørgrav AuthorDate: 2024-09-04 17:32:23 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-10-06 09:12:24 +0000 date: Fix a few nits. * Don't use `asprintf()` when `strdup()` can do the job just as well. * Fix a couple of typos in a comment. Fixes: eeb04a736cb9 MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D46533 (cherry picked from commit a8ddd1926a34fc20970d9ceaad71b31fc414b1c5) date: Documentation nits. * Fix spurious capitalization. * Fix inconsistent quoting. * Use `Dq` rather than ASCII double quotes. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: 0mp Differential Revision: https://reviews.freebsd.org/D46622 (cherry picked from commit 355ebf80b1ed98cf7ca9c51ce7e3e6dcb376853d) --- bin/date/date.1 | 9 ++++++--- bin/date/date.c | 8 ++++---- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bin/date/date.1 b/bin/date/date.1 index 29cde37ca904..62d28a7df0a0 100644 --- a/bin/date/date.1 +++ b/bin/date/date.1 @@ -29,7 +29,7 @@ .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF .\" SUCH DAMAGE. .\" -.Dd May 2, 2024 +.Dd September 10, 2024 .Dt DATE 1 .Os .Sh NAME @@ -538,8 +538,11 @@ Finally the command .Pp .Dl "TZ=America/Los_Angeles date -z Europe/Paris -j 0900" .Pp -will print the time in the "Europe/Paris" timezone when it is 9:00 in The -America/Los_Angeles timezone. +will print the time in the +.Dq Europe/Paris +timezone when it is 9:00 in the +.Dq America/Los_Angeles +timezone. .Sh DIAGNOSTICS It is invalid to combine the .Fl I diff --git a/bin/date/date.c b/bin/date/date.c index 6b6e1f69cabc..d32993dc1eda 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -395,8 +395,8 @@ strftime_ns(char * __restrict s, size_t maxsize, const char * __restrict format, bool seen_percent; seen_percent = false; - if (asprintf(&newformat, "%s", format) < 0) - err(1, "asprintf"); + if ((newformat = strdup(format)) == NULL) + err(1, "strdup"); tok = newformat; for (tok = newformat; *tok != '\0'; tok++) { switch (*tok) { @@ -418,9 +418,9 @@ strftime_ns(char * __restrict s, size_t maxsize, const char * __restrict format, suffix = tok + 1; /* * Construct a new format string from the - * prefix (i.e., the part of the old fromat + * prefix (i.e., the part of the old format * from its beginning to the currently handled - * "%N" conversion specification, the + * "%N" conversion specification), the * nanoseconds, and the suffix (i.e., the part * of the old format from the next token to the * end).