diff options
author | Toomas Soome <tsoome@me.com> | 2019-01-24 20:52:32 +0200 |
---|---|---|
committer | Toomas Soome <tsoome@me.com> | 2019-07-19 21:55:50 +0300 |
commit | cd76e30f6fbd14ce10675906631d3f1233c2dcac (patch) | |
tree | 22c380a6ea54243192a9c360c52287429b9b0b23 | |
parent | 723f377c3492a26888b7d19197a1ec00eebebafe (diff) | |
download | illumos-joyent-cd76e30f6fbd14ce10675906631d3f1233c2dcac.tar.gz |
11389 logadm: NULL pointer errors
Reviewed by: Andy Fiddaman <andy@omniosce.org>
Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r-- | usr/src/cmd/logadm/main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr/src/cmd/logadm/main.c b/usr/src/cmd/logadm/main.c index 93a54a60ed..24eb9f8a38 100644 --- a/usr/src/cmd/logadm/main.c +++ b/usr/src/cmd/logadm/main.c @@ -831,7 +831,7 @@ rotateto(struct fn *fnp, struct opts *opts, int n, struct fn *recentlog, fn_free(dirname); /* do the rename */ - if (n == 0 && opts_count(opts, "c") != NULL) { + if (n == 0 && opts_count(opts, "c") != 0) { docopytruncate(opts, fn_s(fnp), fn_s(newfile)); } else if (n == 0 && opts_count(opts, "M")) { struct fn *rawcmd = fn_new(opts_optarg(opts, "M")); @@ -1112,7 +1112,7 @@ docopytruncate(struct opts *opts, const char *file, const char *file_copy) ssize_t len; /* print info if necessary */ - if (opts_count(opts, "vn") != NULL) { + if (opts_count(opts, "vn") != 0) { (void) out("# log rotation via atomic copy and truncation" " (-c flag):\n"); (void) out("# copy %s to %s\n", file, file_copy); |