projects
/
monky
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c9bde00
)
Fix for segfault in top_name stuff.
author
Brenden Matthews
<brenden@diddyinc.com>
Wed, 20 Oct 2010 00:36:29 +0000
(17:36 -0700)
committer
Brenden Matthews
<brenden@diddyinc.com>
Wed, 20 Oct 2010 00:36:29 +0000
(17:36 -0700)
src/top.c
patch
|
blob
|
history
diff --git
a/src/top.c
b/src/top.c
index
18b4ee6
..
29b169b
100644
(file)
--- a/
src/top.c
+++ b/
src/top.c
@@
-986,9
+986,11
@@
void print_top(struct text_object *obj, char *p, int p_max_size)
switch (td->type) {
case TOP_NAME:
- width = MIN(p_max_size, (int)top_name_width + 1);
- snprintf(p, width + 1, "%-*s", width,
- needed[td->num]->name);
+ if (needed[td->num]->name) {
+ width = MIN(p_max_size, (int)top_name_width + 1);
+ snprintf(p, width + 1, "%-*s", width,
+ needed[td->num]->name);
+ }
break;
case TOP_CPU:
width = MIN(p_max_size, 7);