From owner-dev-commits-src-all@freebsd.org Mon Apr 19 22:10:18 2021 Return-Path: Delivered-To: dev-commits-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 1A0185D8D15; Mon, 19 Apr 2021 22:10:18 +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 4FPLbZ0Btmz4vJK; Mon, 19 Apr 2021 22:10:18 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 EDC0027095; Mon, 19 Apr 2021 22:10:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 13JMAHo4033755; Mon, 19 Apr 2021 22:10:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 13JMAHe0033748; Mon, 19 Apr 2021 22:10:17 GMT (envelope-from git) Date: Mon, 19 Apr 2021 22:10:17 GMT Message-Id: <202104192210.13JMAHe0033748@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: 2763a0928aee - main - config: style for '\0' and NULL 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: 2763a0928aeedc3c76b0953af9fa7b948026d81b Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Apr 2021 22:10:18 -0000 The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2763a0928aeedc3c76b0953af9fa7b948026d81b commit 2763a0928aeedc3c76b0953af9fa7b948026d81b Author: Warner Losh AuthorDate: 2021-04-19 22:09:42 +0000 Commit: Warner Losh CommitDate: 2021-04-19 22:10:12 +0000 config: style for '\0' and NULL Use NULL for pointers instead of '0' (though hey are the same thing in these cases). Ditto for using the zero character '\0' instead of a naked 0 (ditto). Reviewed by: markj@ Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D29847 --- usr.sbin/config/mkmakefile.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/usr.sbin/config/mkmakefile.c b/usr.sbin/config/mkmakefile.c index 00eb3422d1d0..4f3bd13ffca3 100644 --- a/usr.sbin/config/mkmakefile.c +++ b/usr.sbin/config/mkmakefile.c @@ -193,7 +193,7 @@ sanitize_envline(char *result, const char *src) /* If there is no '=' it's not a well-formed name=value line. */ if ((eq = strchr(src, '=')) == NULL) { - *result = 0; + *result = '\0'; return; } dst = result; @@ -210,7 +210,7 @@ sanitize_envline(char *result, const char *src) /* If it was all leading space, we don't have a well-formed line. */ if (leading) { - *result = 0; + *result = '\0'; return; } @@ -221,7 +221,7 @@ sanitize_envline(char *result, const char *src) /* Copy chars after the '=', skipping any leading whitespace. */ leading = true; - while ((c = *src++) != 0) { + while ((c = *src++) != '\0') { if (leading && (isspace(c) || c == '"')) continue; *dst++ = c; @@ -230,7 +230,7 @@ sanitize_envline(char *result, const char *src) /* If it was all leading space, it's a valid 'var=' (nil value). */ if (leading) { - *dst = 0; + *dst = '\0'; return; } @@ -238,7 +238,7 @@ sanitize_envline(char *result, const char *src) while (isspace(dst[-1]) || dst[-1] == '"') --dst; - *dst = 0; + *dst = '\0'; } /* @@ -444,10 +444,10 @@ next: compile = 0; match = 1; nreqs = 0; - compilewith = 0; - depends = 0; - clean = 0; - warning = 0; + compilewith = NULL; + depends = NULL; + clean = NULL; + warning = NULL; std = 0; imp_rule = 0; no_ctfconvert = 0;