From: Denys Vlasenko Date: Thu, 4 Nov 2010 22:30:11 +0000 (+0100) Subject: powertop: fix last line detection in process_timer_stats() X-Git-Tag: 1_18_0~25^2 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=dea28e1e558228d9c46cdb25c7f00986d9d52bcc;p=oweals%2Fbusybox.git powertop: fix last line detection in process_timer_stats() Signed-off-by: Denys Vlasenko --- diff --git a/procps/powertop.c b/procps/powertop.c index 87efbe892..da7f05258 100644 --- a/procps/powertop.c +++ b/procps/powertop.c @@ -420,12 +420,12 @@ static NOINLINE int process_timer_stats(void) int idx; count = skip_whitespace(buf); - if (strcmp(strchrnul(count, ' '), " total events") == 0) - break; p = strchr(count, ','); if (!p) continue; *p++ = '\0'; + if (strcmp(skip_non_whitespace(count), " total events") == 0) + break; if (strchr(count, 'D')) continue; /* deferred */ p = skip_whitespace(p); /* points to pid now */