From nobody Thu Sep 28 15:52:41 2023 X-Original-To: dev-commits-src-all@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 4RxJ096tMZz4txtZ; Thu, 28 Sep 2023 15:52:41 +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 4RxJ096M99z4LMt; Thu, 28 Sep 2023 15:52:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1695916361; 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=DJy90gNDtkSRNx+P+4cKEka5tZko8UOCWPjc5KqsbG4=; b=kwEpNYzqCoYXZiCxwRKrJESHMnhEAxSuUBqGMbQc9r0P4e/xHRSMYg6L33N9xvC/mjwFRR aX+6LsDjfAfN6qFXglPWsl+C1V9vKZTwhFgJKWYt203j+SxtNIJ0kPFo+x77JwtnVFJpmz 8s6Hq2aEs8S/A/k+QaP1nyXuechJOe9L1wxygdAqkHixoo+yZmDWNoLjfv4867Kv5tqj3E c6PBCePae2M4SCzdTMYqP+8sNA/ySZWhCDBDVrecp+5QEZr1YDdHO2ZHzO5BTLpxMlTeaV Uxeit4hi3utEu5j3b6VSAdMMo6wCE0y9WzYqHlp/GBClto+8xmzNLat8MuLQ4w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1695916361; a=rsa-sha256; cv=none; b=m/Pr/0eGq4VYWxSo2J6B/B48UOZCMFyUwRCwRN8sZxlqbjbhl/YkCuhRP+o9JOwooKyLAN RDXwpbN2/L/k5HF9PMA8zk3ZLvNHWnQbEmyPdcD0mLTIp2ZpS3I/aiobvnmAToZir1v2Qs N0bd3+jUDze0YVY5k1v635H+AsoUUDHa09O2AA2fecmKLJ6+aiFeuPq+EJ7Z6eVt/KNUol pOAG8AFYiglEsbUiioWokXAC4vKX4V95OT2o4szNwAxZpQ3ilXpsrjXLhr8wbB6ZTrO/D8 jMugm0vSOot+A137l+Jp7dDjHn4Oi8SYQcP+RmGCOmkW+DIhg2ux9MBqTJe67A== 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=1695916361; 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=DJy90gNDtkSRNx+P+4cKEka5tZko8UOCWPjc5KqsbG4=; b=NjnhqFK8dYbfnXuXlJlJ+9MHVLG4E8V3zdYnNLCAneLmv6aG10XtrvQAgOAtk+uZMfvwHj 8//UQVv+N90xbeqAjrs14eqgg4OVg1Z/etd5IFNqT85MEHfJOFLMOVmP0t+oojll/iey3N LHGGc3ZfLzjueXTaoDuQvm+DFxHHUo6jVm9psUtM8iR5YjDtDwutQfbCq8f14wG2jG1peS fn1Ri1gCU+UM2T4+IbwBDfpTyFlvJInizP8gM45JBoOHbdoVkT4UhziE9j04K8J/V2cXWa uYF2I74GoM/mZXG5YD7lAa5UrbIptdFQcP1nhdQ1iNkfVYt49tAK2sehDPXIPg== 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 4RxJ0957YFzDLB; Thu, 28 Sep 2023 15:52:41 +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 38SFqfFr022318; Thu, 28 Sep 2023 15:52:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 38SFqfDr022315; Thu, 28 Sep 2023 15:52:41 GMT (envelope-from git) Date: Thu, 28 Sep 2023 15:52:41 GMT Message-Id: <202309281552.38SFqfDr022315@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: 09080d8ec52b - main - syslogd: Fix sizeof() styling List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 09080d8ec52bb37ccb1c6bd99fe6360b68225092 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=09080d8ec52bb37ccb1c6bd99fe6360b68225092 commit 09080d8ec52bb37ccb1c6bd99fe6360b68225092 Author: Jake Freeland AuthorDate: 2023-09-01 02:50:55 +0000 Commit: Mark Johnston CommitDate: 2023-09-28 15:51:53 +0000 syslogd: Fix sizeof() styling Use parentheses when applying sizeof() per style(9). Reviewed by: markj, emaste MFC after: 3 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D41376 --- usr.sbin/syslogd/syslogd.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/usr.sbin/syslogd/syslogd.c b/usr.sbin/syslogd/syslogd.c index 5965eb2b0252..659b71385087 100644 --- a/usr.sbin/syslogd/syslogd.c +++ b/usr.sbin/syslogd/syslogd.c @@ -809,7 +809,7 @@ main(int argc, char *argv[]) setlinebuf(stdout); consfile.f_type = F_CONSOLE; - (void)strlcpy(consfile.fu_fname, ctty + sizeof _PATH_DEV - 1, + (void)strlcpy(consfile.fu_fname, ctty + sizeof(_PATH_DEV) - 1, sizeof(consfile.fu_fname)); (void)strlcpy(bootfile, getbootfile(), sizeof(bootfile)); @@ -2923,7 +2923,7 @@ parse_selector(const char *p, struct filed *f) pri = decode(buf, prioritynames); if (pri < 0) { errno = 0; - (void)snprintf(ebuf, sizeof ebuf, + (void)snprintf(ebuf, sizeof(ebuf), "unknown priority name \"%s\"", buf); logerror(ebuf); free(f); @@ -2950,7 +2950,7 @@ parse_selector(const char *p, struct filed *f) i = decode(buf, facilitynames); if (i < 0) { errno = 0; - (void)snprintf(ebuf, sizeof ebuf, + (void)snprintf(ebuf, sizeof(ebuf), "unknown facility name \"%s\"", buf); logerror(ebuf); @@ -3461,11 +3461,11 @@ allowaddr(char *s __unused) printf("numeric, "); getnameinfo(sstosa(&ap->a_addr), (sstosa(&ap->a_addr))->sa_len, - ip, sizeof ip, NULL, 0, NI_NUMERICHOST); + ip, sizeof(ip), NULL, 0, NI_NUMERICHOST); printf("addr = %s, ", ip); getnameinfo(sstosa(&ap->a_mask), (sstosa(&ap->a_mask))->sa_len, - ip, sizeof ip, NULL, 0, NI_NUMERICHOST); + ip, sizeof(ip), NULL, 0, NI_NUMERICHOST); printf("mask = %s; ", ip); } else { printf("domainname = %s; ", ap->a_name); @@ -3513,8 +3513,8 @@ validate(struct sockaddr *sa, const char *hname) if (getaddrinfo(name, NULL, &hints, &res) == 0) freeaddrinfo(res); else if (strchr(name, '.') == NULL) { - strlcat(name, ".", sizeof name); - strlcat(name, LocalDomain, sizeof name); + strlcat(name, ".", sizeof(name)); + strlcat(name, LocalDomain, sizeof(name)); } if (getnameinfo(sa, sa->sa_len, ip, sizeof(ip), port, sizeof(port), NI_NUMERICHOST | NI_NUMERICSERV) != 0) @@ -3648,7 +3648,7 @@ p_open(const char *prog, int *rpd) */ if (fcntl(pfd[1], F_SETFL, O_NONBLOCK) == -1) { /* This is bad. */ - (void)snprintf(errmsg, sizeof errmsg, + (void)snprintf(errmsg, sizeof(errmsg), "Warning: cannot change pipe to PID %d to " "non-blocking behaviour.", (int)pid);