diff options
author | Toomas Soome <tsoome@me.com> | 2019-01-21 20:33:24 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-06-24 21:34:57 +0300 |
commit | f21450b8fa7a1530d48dc06401e691df1b8965fa (patch) | |
tree | 5b85c667c86b70529f571400bbb51f9fbda273e9 /usr/src/lib/libadm/common/ckdate.c | |
parent | 5f060f5100426465bddc18c6f81b146ccee30eb8 (diff) | |
download | illumos-gate-f21450b8fa7a1530d48dc06401e691df1b8965fa.tar.gz |
11121 libadm: NULL pointer errors
Reviewed by: Peter Tribble <peter.tribble@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
Diffstat (limited to 'usr/src/lib/libadm/common/ckdate.c')
-rw-r--r-- | usr/src/lib/libadm/common/ckdate.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr/src/lib/libadm/common/ckdate.c b/usr/src/lib/libadm/common/ckdate.c index 9ae38509e1..43b5582ed6 100644 --- a/usr/src/lib/libadm/common/ckdate.c +++ b/usr/src/lib/libadm/common/ckdate.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ -/* All Rights Reserved */ +/* All Rights Reserved */ /* @@ -299,7 +299,7 @@ int ckdate_val(char *fmt, char *input) { char ltrl, dfl; - int valid = 1; /* time of day string is valid for format */ + int valid = 1; /* time of day string is valid for format */ if ((fmt != NULL) && (fmtcheck(fmt) == 1)) return (4); @@ -392,9 +392,8 @@ ckdate_val(char *fmt, char *input) fmt++; } /* end of while fmt and valid */ - if ((*fmt == NULL) && ((input != NULL) && *input != 0)) { - if (*input != NULL) - valid = 0; + if ((*fmt == '\0') && ((input != NULL) && *input != '\0')) { + valid = 0; } return ((valid == 0)); } |