diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2011-04-06 11:36:27 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2011-04-06 11:36:27 +0000 |
commit | e2ddf551fe54f5fd63dbb0131d6835d07f172753 (patch) | |
tree | ee263115c37260360e628dc4fc5e029d18e30311 /sbin | |
parent | ecdee9dbaa69f9aa6f959777e5e515c31bb6a0f8 (diff) |
Avoid using NULL in non-pointer contexts: use 0 for integer values and '\0'
for chars.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/atactl/atactl.c | 14 | ||||
-rw-r--r-- | sbin/isakmpd/policy.c | 6 | ||||
-rw-r--r-- | sbin/modload/elf.c | 4 | ||||
-rw-r--r-- | sbin/mount/mount.c | 4 |
4 files changed, 14 insertions, 14 deletions
diff --git a/sbin/atactl/atactl.c b/sbin/atactl/atactl.c index 84a51785668..25c25f4bdc7 100644 --- a/sbin/atactl/atactl.c +++ b/sbin/atactl/atactl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atactl.c,v 1.42 2009/04/16 07:40:44 grange Exp $ */ +/* $OpenBSD: atactl.c,v 1.43 2011/04/06 11:36:25 miod Exp $ */ /* $NetBSD: atactl.c,v 1.4 1999/02/24 18:49:14 jwise Exp $ */ /*- @@ -154,7 +154,7 @@ struct bitinfo ata_caps[] = { { ATA_CAP_STBY, "ATA standby timer values" }, { WDC_CAP_IORDY, "IORDY operation" }, { WDC_CAP_IORDY_DSBL, "IORDY disabling" }, - { NULL, NULL }, + { 0, NULL }, }; struct bitinfo ata_vers[] = { @@ -172,7 +172,7 @@ struct bitinfo ata_vers[] = { { WDC_VER_ATA12, "ATA-12" }, { WDC_VER_ATA13, "ATA-13" }, { WDC_VER_ATA14, "ATA-14" }, - { NULL, NULL }, + { 0, NULL }, }; struct bitinfo ata_cmd_set1[] = { @@ -190,7 +190,7 @@ struct bitinfo ata_cmd_set1[] = { { WDC_CMD1_REMOV, "Removable Media feature set" }, { WDC_CMD1_SEC, "Security Mode feature set" }, { WDC_CMD1_SMART, "SMART feature set" }, - { NULL, NULL }, + { 0, NULL }, }; struct bitinfo ata_cmd_set2[] = { @@ -207,7 +207,7 @@ struct bitinfo ata_cmd_set2[] = { { ATA_CMD2_CFA, "CFA feature set" }, { ATA_CMD2_RWQ, "READ/WRITE DMA QUEUED commands" }, { WDC_CMD2_DM, "DOWNLOAD MICROCODE command" }, - { NULL, NULL }, + { 0, NULL }, }; struct bitinfo ata_cmd_ext[] = { @@ -215,7 +215,7 @@ struct bitinfo ata_cmd_ext[] = { { ATAPI_CMDE_MSER, "Media serial number" }, { ATAPI_CMDE_TEST, "SMART self-test" }, { ATAPI_CMDE_SLOG, "SMART error logging" }, - { NULL, NULL }, + { 0, NULL }, }; /* @@ -447,7 +447,7 @@ void print_bitinfo(const char *f, u_int bits, struct bitinfo *binfo) { - for (; binfo->bitmask != NULL; binfo++) + for (; binfo->bitmask != 0; binfo++) if (bits & binfo->bitmask) printf(f, binfo->string); } diff --git a/sbin/isakmpd/policy.c b/sbin/isakmpd/policy.c index 190385801ec..920cd6fcad8 100644 --- a/sbin/isakmpd/policy.c +++ b/sbin/isakmpd/policy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: policy.c,v 1.92 2010/09/22 13:45:16 mikeb Exp $ */ +/* $OpenBSD: policy.c,v 1.93 2011/04/06 11:36:25 miod Exp $ */ /* $EOM: policy.c,v 1.49 2000/10/24 13:33:39 niklas Exp $ */ /* @@ -1737,12 +1737,12 @@ policy_callback(char *name) return phase_1; if (strcmp(name, "GMTTimeOfDay") == 0) { - tt = time((time_t)NULL); + tt = time((time_t *)NULL); strftime(mytimeofday, 14, "%Y%m%d%H%M%S", gmtime(&tt)); return mytimeofday; } if (strcmp(name, "LocalTimeOfDay") == 0) { - tt = time((time_t)NULL); + tt = time((time_t *)NULL); strftime(mytimeofday, 14, "%Y%m%d%H%M%S", localtime(&tt)); return mytimeofday; } diff --git a/sbin/modload/elf.c b/sbin/modload/elf.c index fe223ece602..d6c3da523e0 100644 --- a/sbin/modload/elf.c +++ b/sbin/modload/elf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elf.c,v 1.7 2004/12/28 09:05:18 deraadt Exp $ */ +/* $OpenBSD: elf.c,v 1.8 2011/04/06 11:36:26 miod Exp $ */ /* $NetBSD: elf.c,v 1.8 2002/01/03 21:45:58 jdolecek Exp $ */ /* @@ -328,7 +328,7 @@ elf_linkcmd(char *buf, size_t len, const char *kernel, { ssize_t n; - if (data_offset == NULL) + if (data_offset == 0) n = snprintf(buf, len, LINKCMD, kernel, entry, outfile, address, object); else diff --git a/sbin/mount/mount.c b/sbin/mount/mount.c index ddad3f35ed2..8f156df3998 100644 --- a/sbin/mount/mount.c +++ b/sbin/mount/mount.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mount.c,v 1.50 2009/10/27 23:59:33 deraadt Exp $ */ +/* $OpenBSD: mount.c,v 1.51 2011/04/06 11:36:26 miod Exp $ */ /* $NetBSD: mount.c,v 1.24 1995/11/18 03:34:29 cgd Exp $ */ /* @@ -93,7 +93,7 @@ static struct opt { { MNT_ROOTFS, 1, "root file system", "" }, { MNT_SYNCHRONOUS, 0, "synchronous", "sync" }, { MNT_SOFTDEP, 0, "softdep", "softdep" }, - { NULL, 0, "", "" } + { 0, 0, "", "" } }; int |