From fa70080fe06ce87a210e430a867d5954de46aeab Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Thu, 6 Feb 1997 06:47:04 +0000 Subject: (w_get_host): Don't use strlen on it if *HOST is 0. --- utils/w.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'utils') 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 @@ -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}; -- cgit v1.2.3