summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkoptions.c
diff options
context:
space:
mode:
authoraraujo <araujo@FreeBSD.org>2016-04-27 03:06:53 +0000
committeraraujo <araujo@FreeBSD.org>2016-04-27 03:06:53 +0000
commitda3816f04d09c0ed578e27cdd83ba204317f0688 (patch)
tree8142d37b8cc6ab2830ddea6fe21b60868235fd85 /usr.sbin/config/mkoptions.c
parentf2a21f34e8f340f93f6bcca39dda6e5613e4b256 (diff)
downloadFreeBSD-src-da3816f04d09c0ed578e27cdd83ba204317f0688.zip
FreeBSD-src-da3816f04d09c0ed578e27cdd83ba204317f0688.tar.gz
For pointers use NULL instead of 0.
Reviewed by: rpaulo MFC after: 2 weeks. Differential Revision: https://reviews.freebsd.org/D5946
Diffstat (limited to 'usr.sbin/config/mkoptions.c')
-rw-r--r--usr.sbin/config/mkoptions.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/usr.sbin/config/mkoptions.c b/usr.sbin/config/mkoptions.c
index b5d6e34..8aca410 100644
--- a/usr.sbin/config/mkoptions.c
+++ b/usr.sbin/config/mkoptions.c
@@ -172,9 +172,9 @@ do_option(char *name)
remember(file);
inf = fopen(file, "r");
- if (inf == 0) {
+ if (inf == NULL) {
outf = fopen(file, "w");
- if (outf == 0)
+ if (outf == NULL)
err(1, "%s", file);
/* was the option in the config file? */
@@ -200,14 +200,14 @@ do_option(char *name)
char *invalue;
/* get the #define */
- if ((inw = get_word(inf)) == 0 || inw == (char *)EOF)
+ if ((inw = get_word(inf)) == NULL || inw == (char *)EOF)
break;
/* get the option name */
- if ((inw = get_word(inf)) == 0 || inw == (char *)EOF)
+ if ((inw = get_word(inf)) == NULL || inw == (char *)EOF)
break;
inw = ns(inw);
/* get the option value */
- if ((cp = get_word(inf)) == 0 || cp == (char *)EOF)
+ if ((cp = get_word(inf)) == NULL || cp == (char *)EOF)
break;
/* option value */
invalue = ns(cp); /* malloced */
@@ -267,7 +267,7 @@ do_option(char *name)
}
outf = fopen(file, "w");
- if (outf == 0)
+ if (outf == NULL)
err(1, "%s", file);
while (!SLIST_EMPTY(&op_head)) {
op = SLIST_FIRST(&op_head);
@@ -366,10 +366,10 @@ read_option_file(const char *fname, int flags)
char genopt[MAXPATHLEN];
fp = fopen(fname, "r");
- if (fp == 0)
+ if (fp == NULL)
return (0);
while ((wd = get_word(fp)) != (char *)EOF) {
- if (wd == 0)
+ if (wd == NULL)
continue;
if (wd[0] == '#') {
while (((wd = get_word(fp)) != (char *)EOF) && wd)
@@ -380,7 +380,7 @@ read_option_file(const char *fname, int flags)
val = get_word(fp);
if (val == (char *)EOF)
return (1);
- if (val == 0) {
+ if (val == NULL) {
if (flags) {
fprintf(stderr, "%s: compat file requires two"
" words per line at %s\n", fname, this);
OpenPOWER on IntegriCloud