summaryrefslogtreecommitdiff
path: root/usr/src/cmd/file/magicutils.c
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-24 14:28:58 +0200
committerToomas Soome <tsoome@me.com>2019-07-11 18:06:20 +0300
commit5521b7639b10e877e2e517a3498114aaf131b72d (patch)
treeddc8de3c5700a2d885aefe16b149f157c774af4c /usr/src/cmd/file/magicutils.c
parentbcc2c2b83b7fa504ab39a003964e07c06e7af053 (diff)
downloadillumos-joyent-5521b7639b10e877e2e517a3498114aaf131b72d.tar.gz
11334 file: NULL pointer errors
Reviewed by: Garrett D'Amore <garrett@damore.org> Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/cmd/file/magicutils.c')
-rw-r--r--usr/src/cmd/file/magicutils.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr/src/cmd/file/magicutils.c b/usr/src/cmd/file/magicutils.c
index 3dd23e92f8..1668ecc7cf 100644
--- a/usr/src/cmd/file/magicutils.c
+++ b/usr/src/cmd/file/magicutils.c
@@ -304,7 +304,7 @@ f_mkmtab(char *magfile, int cflg, int first)
File, magfile, p, lcnt);
continue;
}
- *p2++ = NULL;
+ *p2++ = '\0';
ep->e_off = strtol((const char *)p, (char **)NULL, 0);
while (*p2 == '\t')
p2++;
@@ -318,7 +318,7 @@ f_mkmtab(char *magfile, int cflg, int first)
File, magfile, p, lcnt);
continue;
}
- *p2++ = NULL;
+ *p2++ = '\0';
p3 = strchr(p, '&');
if (p3 != NULL) {
*p3++ = '\0';
@@ -329,10 +329,10 @@ f_mkmtab(char *magfile, int cflg, int first)
}
switch (*p) {
case 'd':
- if (*(p+1) == NULL) {
+ if (*(p+1) == '\0') {
/* d */
ep->e_type = LONG;
- } else if (*(p+2) == NULL) { /* d? */
+ } else if (*(p+2) == '\0') { /* d? */
switch (*(p+1)) {
case 'C':
case '1':
@@ -377,10 +377,10 @@ f_mkmtab(char *magfile, int cflg, int first)
}
break;
case 'u':
- if (*(p+1) == NULL) {
+ if (*(p+1) == '\0') {
/* u */
ep->e_type = ULONG;
- } else if (*(p+2) == NULL) { /* u? */
+ } else if (*(p+2) == '\0') { /* u? */
switch (*(p+1)) {
case 'C':
case '1':
@@ -450,7 +450,7 @@ f_mkmtab(char *magfile, int cflg, int first)
File, magfile, p, lcnt);
continue;
}
- *p2++ = NULL;
+ *p2++ = '\0';
if (ep->e_type != STR) {
opc = *p++;
switch (opc) {