I received the following patch from Tilmann Hentze <0xcafe@directbox.com>
in an email:
> Hello,
> there are processes, that have space characters in their names, for example
> Firefoxe's "Web Content" process.
> The current sscanf line for Linux would only considers the first part of
> the process name, e.g. "Web" and cut off the rest.
> Attached patch should consider the complete process name between parentheses.
> Further I did not touch the handling of removal of "kdeinit", since
> I am not using KDE and am not sure if the assumptions in the source code
> are still valid.
> Best Regards,
> Tilmann.
Signed-off-by: Doug Torrance <dtorrance@piedmont.edu>
Based partially on a patch by wbk to fix Gentoo bug #410093 [1]. From the
bug report:
After fixing the /proc/meminfo issue, another bug will emerge on systems
where total system RAM in bytes exceeds INT_MAX. The correct top three
processes will be identified, but their load bars will have the wrong
value. This is caused by a value overflow due to storing total system
memory in an "int" type variable. We will end up thinking ((Total RAM)
modulo (INT_MAX)) is our total system RAM, so our percentages will be
inflated when drawing the load bar. This fix will require a bit more care
to follow the flow of data and ensure this value isn't being cast to "int"
along the way. Function return types will need to be changed.
[1] https://bugs.gentoo.org/show_bug.cgi?id=410093