ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/libstatgrab/src/saidar/saidar.c
(Generate patch)

Comparing projects/libstatgrab/src/saidar/saidar.c (file contents):
Revision 1.32 by ats, Sun Nov 7 12:36:04 2004 UTC vs.
Revision 1.33 by tdb, Mon Jan 17 16:34:26 2005 UTC

# Line 69 | Line 69 | stats_t stats;
69   char *size_conv(long long number){
70          char type[] = {'B', 'K', 'M', 'G', 'T'};
71          int x=0;
72 +        int sign=1;
73          static char string[10];
74  
75 +        if(number < 0){
76 +                sign=-1;
77 +                number=-number;
78 +        }
79 +
80          for(;x<5;x++){
81                  if( (number/1024) < (100)) {
82                          break;
# Line 78 | Line 84 | char *size_conv(long long number){
84                  number = (number/1024);
85          }
86  
87 <        snprintf(string, 10, "%lld%c", number, type[x]);        
87 >        number = number*sign;
88 >
89 >        snprintf(string, 10, "%lld%c", number, type[x]);
90          return string;
91          
92   }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines