[PATCH] powertop: possible a bug entered
Denys Vlasenko
vda.linux at googlemail.com
Thu Nov 4 22:31:37 UTC 2010
On Thursday 04 November 2010 10:50, Maksym Kryzhanovskyy wrote:
> It seems that we need '\0' immediately after " total events" in the buf,
> otherwise strcmp does not match. See attachment.
Yes, indeed... do you think this simple fix is enough? -
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;
--
vda
More information about the busybox
mailing list