projects
/
monky
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e26c997
)
top: fix segfault for $if_running
author
Phil Sutter
<phil@nwl.cc>
Thu, 12 Nov 2009 20:32:59 +0000
(21:32 +0100)
committer
Phil Sutter
<phil@nwl.cc>
Thu, 12 Nov 2009 23:02:16 +0000
(
00:02
+0100)
The "name" field may be zero, which makes strcmp() freak out.
src/top.c
patch
|
blob
|
history
diff --git
a/src/top.c
b/src/top.c
index
980cc4c
..
4596557
100644
(file)
--- a/
src/top.c
+++ b/
src/top.c
@@
-131,7
+131,7
@@
struct process *get_process_by_name(const char *name)
struct process *p = first_process;
while (p) {
- if (!strcmp(p->name, name))
+ if (p->name && !strcmp(p->name, name))
return p;
p = p->next;
}