summaryrefslogtreecommitdiffstats
path: root/osdep-darwin.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2009-02-11 19:35:50 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2009-02-11 19:35:50 +0000
commite0fe64b4643ca8c6dcf0c4882e902d8242302bb5 (patch)
tree679719ecce4c9137184c26e0b8d84c5c5443caec /osdep-darwin.c
parentc6193f7f3f082acc0b0ed2c5faed2e0a27e05b0d (diff)
Further unbreakage.
Diffstat (limited to 'osdep-darwin.c')
-rw-r--r--osdep-darwin.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/osdep-darwin.c b/osdep-darwin.c
index 7f9625b0..a2622abe 100644
--- a/osdep-darwin.c
+++ b/osdep-darwin.c
@@ -1,4 +1,4 @@
-/* $Id: osdep-darwin.c,v 1.7 2009-02-11 19:31:58 nicm Exp $ */
+/* $Id: osdep-darwin.c,v 1.8 2009-02-11 19:35:50 nicm Exp $ */
/*
* Copyright (c) 2009 Joshua Elsasser <josh@elsasser.org>
@@ -48,11 +48,12 @@ osdep_get_name(int fd, unused char *tty, unused pid_t *last_pid, char **name)
return (-1);
size = sizeof kp;
- if (sysctl(mib, 4, &kp, &size, NULL, 0) == -1 ||
- kp.kp_proc.p_comm[0] == '\0')
+ if (sysctl(mib, 4, &kp, &size, NULL, 0) == -1)
+ return (-1);
+ if (*kp.kp_proc.p_comm == '\0')
return (-1);
- *name = strdup(kp.kp_proc.p_comm[0]);
+ *name = strdup(kp.kp_proc.p_comm);
return (0);
}