diff options
author | johan <johan@FreeBSD.org> | 2003-04-23 20:33:57 +0000 |
---|---|---|
committer | johan <johan@FreeBSD.org> | 2003-04-23 20:33:57 +0000 |
commit | f0e2ab20a0f8aec13b4380cbf6075819af64c9a7 (patch) | |
tree | 1b4fc9ce9937cf768b06561c18ea95949c37e2a7 | |
parent | 4c6fe8967cf97638f57dc258d70e366088605a53 (diff) | |
download | FreeBSD-src-f0e2ab20a0f8aec13b4380cbf6075819af64c9a7.zip FreeBSD-src-f0e2ab20a0f8aec13b4380cbf6075819af64c9a7.tar.gz |
style(9): use NULL when assigning/comparing a char *,
consitently compare fileid with 0 using == and !=.
Reviewed by: silence on @audit
-rw-r--r-- | sbin/kldconfig/kldconfig.c | 2 | ||||
-rw-r--r-- | sbin/kldstat/kldstat.c | 6 | ||||
-rw-r--r-- | sbin/kldunload/kldunload.c | 10 |
3 files changed, 9 insertions, 9 deletions
diff --git a/sbin/kldconfig/kldconfig.c b/sbin/kldconfig/kldconfig.c index bd4015d..21f4d1c 100644 --- a/sbin/kldconfig/kldconfig.c +++ b/sbin/kldconfig/kldconfig.c @@ -142,7 +142,7 @@ setpath(struct pathhead *pathq) if (sysctl(mib, miblen, NULL, NULL, newpath, strlen(newpath)+1) == -1) err(1, "setting path: sysctl(%s)", pathctl); - if (modpath) + if (modpath != NULL) free(modpath); modpath = newpath; } diff --git a/sbin/kldstat/kldstat.c b/sbin/kldstat/kldstat.c index 3e1adee..be699d5 100644 --- a/sbin/kldstat/kldstat.c +++ b/sbin/kldstat/kldstat.c @@ -92,7 +92,7 @@ main(int argc, char** argv) int c; int verbose = 0; int fileid = 0; - char* filename = 0; + char* filename = NULL; while ((c = getopt(argc, argv, "i:n:v")) != -1) switch (c) { @@ -114,13 +114,13 @@ main(int argc, char** argv) if (argc != 0) usage(); - if (filename) { + if (filename != NULL) { if ((fileid = kldfind(filename)) < 0) err(1, "can't find file %s", filename); } printf("Id Refs Address%*c Size Name\n", POINTER_WIDTH - 7, ' '); - if (fileid) + if (fileid != 0) printfile(fileid, verbose); else for (fileid = kldnext(0); fileid > 0; fileid = kldnext(fileid)) diff --git a/sbin/kldunload/kldunload.c b/sbin/kldunload/kldunload.c index e8b8daf..9893f3a 100644 --- a/sbin/kldunload/kldunload.c +++ b/sbin/kldunload/kldunload.c @@ -50,7 +50,7 @@ main(int argc, char** argv) int c; int verbose = 0; int fileid = 0; - char* filename = 0; + char* filename = NULL; while ((c = getopt(argc, argv, "i:n:v")) != -1) switch (c) { @@ -71,18 +71,18 @@ main(int argc, char** argv) argc -= optind; argv += optind; - if (!fileid && !filename && (argc == 1)) { + if (fileid == 0 && filename == NULL && (argc == 1)) { filename = *argv; argc--; } - if (argc != 0 || (fileid && filename)) + if (argc != 0 || (fileid != 0 && filename != NULL)) usage(); - if (fileid == 0 && filename == 0) + if (fileid == 0 && filename == NULL) usage(); - if (filename) { + if (filename != NULL) { if ((fileid = kldfind(filename)) < 0) err(1, "can't find file %s", filename); } |