From: Brenden Matthews Date: Wed, 20 Oct 2010 00:36:29 +0000 (-0700) Subject: Fix for segfault in top_name stuff. X-Git-Url: http://vcs.maemo.org/git/?a=commitdiff_plain;ds=sidebyside;h=5c555deb64c75b2a6f04dc9c6b52756897567483;p=monky Fix for segfault in top_name stuff. --- diff --git a/src/top.c b/src/top.c index 18b4ee6..29b169b 100644 --- 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);