[BusyBox] bug#1274: top applet WmSize/WmRSS field width problem

Paul Whittaker paw at si1.dod.gov.au
Fri Oct 4 21:16:04 UTC 2002


Package: busybox
Version: 0.60.4
Severity: normal

The top applet was bombing out on me with a "can't skip whitespace" 
error when it encountered a 5-digit VmSize value for an X server 
process.  I fixed this by increasing the size and rss array sizes from 9 
to 12 and changing:

         /* skip whitespace in Wm* fields */
         if (id[0] == 'V' && id[1] == 'm') {
!               i = 3;
!               while (i--) {
!                       if (*buf == ' ') {
!                               buf++;
!                       } else {
!                               error_msg_and_die("ERROR status: can't 
skip whitespace for "
!                                       "'%s' field in:\n%s\n", id,buf);
!                       }
                 }
         }

to:

         /* skip whitespace in Wm* fields */
         if (id[0] == 'V' && id[1] == 'm') {
!               while (*buf == ' ') {
!                       buf++;
                 }
         }

This seems to work OK for me.  I'm baffled by the original code - 
presumably there's a good reason why this is so convoluted, but I can't 
see what it is.




More information about the busybox mailing list