summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToomas Soome <tsoome@me.com>2019-01-26 19:07:30 +0200
committerToomas Soome <tsoome@me.com>2019-07-31 08:28:27 +0300
commit61aaa916808c601f9ee36d96c05ee9dac211d09e (patch)
tree67ab1750452ab90728eaa9e4680207d2d5e4e391
parent352d7aeda1f43047aa9ff2e75cc69021c19a6a07 (diff)
downloadillumos-joyent-61aaa916808c601f9ee36d96c05ee9dac211d09e.tar.gz
11446 whodo: NULL pointer errors
Reviewed by: Andy Fiddaman <andy@omniosce.org> Approved by: Dan McDonald <danmcd@joyent.com>
-rw-r--r--usr/src/cmd/whodo/whodo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr/src/cmd/whodo/whodo.c b/usr/src/cmd/whodo/whodo.c
index 80a781b7b7..fe097ace23 100644
--- a/usr/src/cmd/whodo/whodo.c
+++ b/usr/src/cmd/whodo/whodo.c
@@ -139,7 +139,7 @@ static void prtat(time_t *);
static char *prog;
static int header = 1; /* true if -h flag: don't print heading */
static int lflag = 0; /* true if -l flag: w command format */
-static char *sel_user; /* login of particular user selected */
+static char *sel_user; /* login of particular user selected */
static time_t now; /* current time of day */
static time_t uptime; /* time of last reboot & elapsed time since */
static int nusers; /* number of users logged in now */
@@ -162,7 +162,7 @@ main(int argc, char *argv[])
struct utmpx *ut;
struct utmpx *utmpbegin;
struct utmpx *utmpend;
- struct utmpx *utp;
+ struct utmpx *utp;
struct tm *tm;
struct uproc *up, *parent, *pgrp;
struct psinfo info;
@@ -173,8 +173,8 @@ main(int argc, char *argv[])
struct utsname uts;
DIR *dirp;
struct dirent *dp;
- char pname[64];
- char *fname;
+ char pname[64];
+ char *fname;
int procfd;
int i;
int days, hrs, mins;
@@ -825,10 +825,10 @@ clnarglist(char *arglist)
int err = 0;
/* get rid of unsavory characters */
- for (c = arglist; *c == NULL; c++) {
+ for (c = arglist; *c == '\0'; c++) {
if ((*c < ' ') || (*c > 0176)) {
if (err++ > 5) {
- *arglist = NULL;
+ *arglist = '\0';
break;
}
*c = '?';