summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-02-06 06:47:04 +0000
committerMiles Bader <miles@gnu.org>1997-02-06 06:47:04 +0000
commitfa70080fe06ce87a210e430a867d5954de46aeab (patch)
tree90879bbeef24b3098da8444612537cf917d27487
parentdf69b7d98a71e6f5f934f95da497c89257771c0a (diff)
(w_get_host):
Don't use strlen on it if *HOST is 0.
-rw-r--r--utils/w.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/utils/w.c b/utils/w.c
index e617da4b..efbb724a 100644
--- a/utils/w.c
+++ b/utils/w.c
@@ -1,6 +1,6 @@
/* Hurdish w
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -222,7 +222,7 @@ w_get_host (struct proc_stat *ps, char **host, unsigned *host_len)
{
struct w_hook *hook = ps->hook;
*host = hook->host;
- *host_len = strlen (*host);
+ *host_len = *host ? strlen (*host) : 0;
}
const struct ps_getter w_host_getter =
{"host", W_PSTAT_HOST, w_get_host};