From nobody Wed Sep 04 17:32:46 2024 X-Original-To: dev-commits-src-main@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 4WzV1p4rVYz5VJ98; Wed, 04 Sep 2024 17:32:46 +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 4WzV1p4KSrz4rK4; Wed, 4 Sep 2024 17:32:46 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725471166; 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=xh1A6B9fhI9rvOGbTZV/BNkUlhvLrdy3mYztaO5efZk=; b=LGe+W+KbncQNPn31lfy7ItI4H2FQ5SQAFnQp0T9nNYVHgsT+PBor/G0SFXKYbDnjg+t0Lw Jn7R+pdA2FkrnZFianzeDmakV9kMk+EsUwLwVZR7xf/enkjWhLE2oBOyuJV52V3bFVq2C6 +wn+/APsoeuV/VsCn9huLHKy1OZUi6f1BJaaHC7Unl6bBCjx2t21TSxo1doFIKJni/9VnM wkpAH5Jsy/LJbiwA3/tah6tJDmRrdr6CpyEj+CKQmuO5mc3eAQBFTwMiBTYTwKcfmcyQiW qw40qwvFuoFABg9ckSDc7BHGu/JKwEeC2O3bqPptiQd0sbaAts3Y6v1rgBSioA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725471166; a=rsa-sha256; cv=none; b=bnFWpS+yZvvFk8vwJtU2gguYlmGtd4ktMe0UxIXLGAQnGEtuysnRUi16b9yx2kKNoE76WE eMrpdw0kaGGTOsvUxEWAoW9k4CG9b8mptWSErr2GCIH+hRgEE+YiyzUKPgboEXvD+cdeeX gKaorgLwjSAlaghHnXh5UQEllLSn0vqyF/VXA7KnUvAdy3pD2rFGsnI3KDhwUC9I7x1dQC CSteCwerKmSHU1L9zAEZH5drMudFu6L0U23uaKEKeDBEhOTb0OLlNXMuHwKoQvvoatKtgw rJg4dvAt3vDEobWuYlz8c8WFDROMX3mT5Ig6tLJC1XNIREorWZ1gV7SQ+fl1Xw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725471166; 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=xh1A6B9fhI9rvOGbTZV/BNkUlhvLrdy3mYztaO5efZk=; b=rb8Y6fLjHOM4TgeOWnvLVxY0IsneQ69miPfYk2lKNIAkE8Jyh1l5ZNrHTtVqF94Y559EmB UbO9dpDyP+ftPb21Vr5UKJgvslm98/a8P7InScWVEkN9XjQubBftclg0JC9W/360KoQ1sL lPH6rirzL9/wPdOhStzqUy3kfQa9t8Uz+eC91rktBRL57SCbMDkJlcUq3gU0krc0EUrQvY ATteKDLzI/KEFUeY0onukUIsQMXxhvy+TBudxJz+VF+IdH+WMHGDoyO+Z4YIah4dThLEK/ 2cKuqzJqCb1uWvt608x5P/C5BDXJZ2INUUFx211fuV6MgSzkxuW4UVgl6s20UQ== 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 4WzV1p3wfgzYyn; Wed, 4 Sep 2024 17:32:46 +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 484HWkGL091489; Wed, 4 Sep 2024 17:32:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 484HWkpu091486; Wed, 4 Sep 2024 17:32:46 GMT (envelope-from git) Date: Wed, 4 Sep 2024 17:32:46 GMT Message-Id: <202409041732.484HWkpu091486@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Dag-Erling =?utf-8?Q?Sm=C3=B8rgrav?= Subject: git: a8ddd1926a34 - main - date: Fix a few nits. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: a8ddd1926a34fc20970d9ceaad71b31fc414b1c5 Auto-Submitted: auto-generated The branch main has been updated by des: URL: https://cgit.FreeBSD.org/src/commit/?id=a8ddd1926a34fc20970d9ceaad71b31fc414b1c5 commit a8ddd1926a34fc20970d9ceaad71b31fc414b1c5 Author: Dag-Erling Smørgrav AuthorDate: 2024-09-04 17:32:23 +0000 Commit: Dag-Erling Smørgrav CommitDate: 2024-09-04 17:32:23 +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 --- bin/date/date.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/date/date.c b/bin/date/date.c index 3ce9ee3235fb..01797084c0d6 100644 --- a/bin/date/date.c +++ b/bin/date/date.c @@ -382,8 +382,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) { @@ -405,9 +405,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).