From nobody Mon Apr 29 04:27:14 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 4VSVfV3vS9z5JBSG; Mon, 29 Apr 2024 04:27:14 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VSVfV1Y61z41P5; Mon, 29 Apr 2024 04:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1714364834; 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=nkd+JSM25me7v7cYbB2KpDH60Mu/P7i458RkUFO7kBs=; b=nVhlj2XGNd0j5o12fCQf4SB9sHlK+M2xKXxWSiDHfAUI2mcyinFySeJOEnykX2c7s66gBr 5E9BpCY/gqKDq/zr2X16fUZtmw+tLcJY/C2N/F5v9ay47LBWFVlA5XzaEEkddXV3z/DnOS K6WLdp4Z5hL7SE5qUfdt2+v9X37vAON2Fv06fM0pfLEBRGlVqsHtAMS4zHXhz4wYS+CKx3 EK2Rl6TAiBOIO1cLTIgQ1ONPNxccHYqbm66WO3Ep2CO3uZnUgZSmCEsoLYBuuo7efmjaME emdB55dib3XbwZGyz2hlVZPl5WI/Z0C3aPlf6n8Kg0A1Tpw/YFsu3rD/k5lYsw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1714364834; a=rsa-sha256; cv=none; b=dn76AcPyMHzr6EPf2guG9hRAF979vSoJxK6rsMfAVGLybQNO0r8SCLYcN4t2BXRIH+4j4p P6/3iiinj+h7I5nVufnX5+/i6COYfeAd27HXcdO2LLh58LaBvv4cWiJtkUhwCJUl29dYX/ wTFr3a1M4Qy2oKaCha/ihMnGXZ/5EeUENMrz2LpOtJIbvvdnPkLoQ3H47Cn4hzq+kzbbtl 1vc7dVNEma70JrkEaE5SMYgop4NhJfQ4DbSvNtBZ53Fzh9yaPltfezb5qkI2FpQFLHs1Sc z5yHiEavETPTqs7aDmcgOEXUBTrZ0p8CPKjbefw9AydfOJeDluNIEMqCq9WJ2A== 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=1714364834; 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=nkd+JSM25me7v7cYbB2KpDH60Mu/P7i458RkUFO7kBs=; b=QOQJOf06h2JL5s/z2FmNW8kLwUPa6DPezfm6fDVDgMTVM7u2b5PmML5RdELMcidRZBLZn7 0wRgr9rkvy7DBm7oFFp41z0VthwPmke+EFgaKfdiE9g3hgDQ2RwcbAwRu9pTV8FF5nYP2d tFU1/doSeFHYU9+pe95NqzNxNAt7Yb0VDxiLje/+Qb/2NLqZkPLCyAeztNC4E6EpGNd0OU 67pXTo11M/BzdL63k3UhXhNZgdI9tb2i9ymNo++IIgFY5rtmitGreVOztp1ZoLsNXjTQp7 GPxt80BMBpcFIH0FO5TqHTtvaGqH94K7JJerMT8CUUGxJUZrvZJTS3F3WI5SCg== 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 4VSVfV12FwzvGb; Mon, 29 Apr 2024 04:27:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43T4REiT044536; Mon, 29 Apr 2024 04:27:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43T4RE3A044533; Mon, 29 Apr 2024 04:27:14 GMT (envelope-from git) Date: Mon, 29 Apr 2024 04:27:14 GMT Message-Id: <202404290427.43T4RE3A044533@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: d1d652c06015 - main - rtadvctl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) 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: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d1d652c060150985e1e580eb57b4b6829f6845c9 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=d1d652c060150985e1e580eb57b4b6829f6845c9 commit d1d652c060150985e1e580eb57b4b6829f6845c9 Author: Elyes Haouas AuthorDate: 2024-04-29 02:55:30 +0000 Commit: Warner Losh CommitDate: 2024-04-29 03:24:46 +0000 rtadvctl: Use nitems(foo) instead of sizeof(foo)/sizeof(foo[0]) Pull Request: https://github.com/freebsd/freebsd-src/pull/888 Signed-off-by: Elyes Haouas --- usr.sbin/rtadvctl/rtadvctl.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/rtadvctl/rtadvctl.c b/usr.sbin/rtadvctl/rtadvctl.c index 727fa6ee1a52..9fdb643cef10 100644 --- a/usr.sbin/rtadvctl/rtadvctl.c +++ b/usr.sbin/rtadvctl/rtadvctl.c @@ -27,8 +27,8 @@ * */ +#include #include -#include #include #include #include @@ -137,7 +137,7 @@ usage(void) { int i; - for (i = 0; (size_t)i < sizeof(dtable)/sizeof(dtable[0]); i++) { + for (i = 0; (size_t)i < nitems(dtable); i++) { if (dtable[i].dt_comm == NULL) break; printf("%s\n", dtable[i].dt_comm); @@ -172,7 +172,7 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - for (i = 0; (size_t)i < sizeof(dtable)/sizeof(dtable[0]); i++) { + for (i = 0; (size_t)i < nitems(dtable); i++) { if (dtable[i].dt_comm == NULL || strcmp(dtable[i].dt_comm, argv[0]) == 0) { action = dtable[i].dt_act;