diff options
author | Miles Bader <miles@gnu.org> | 1997-02-06 06:47:04 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-02-06 06:47:04 +0000 |
commit | fa70080fe06ce87a210e430a867d5954de46aeab (patch) | |
tree | 90879bbeef24b3098da8444612537cf917d27487 | |
parent | df69b7d98a71e6f5f934f95da497c89257771c0a (diff) |
(w_get_host):
Don't use strlen on it if *HOST is 0.
-rw-r--r-- | utils/w.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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}; |