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

Comparing projects/libstatgrab/src/libstatgrab/memory_stats.c (file contents):
Revision 1.15 by ats, Fri Oct 24 17:03:20 2003 UTC vs.
Revision 1.16 by ats, Fri Oct 24 17:26:43 2003 UTC

# Line 96 | Line 96 | mem_stat_t *get_memory_stats(){
96   #endif
97  
98   #ifdef LINUX
99 <        f = fopen("/proc/meminfo", "r");
100 <        if (f == NULL) {
99 >        if ((f = fopen("/proc/meminfo", "r")) == NULL) {
100                  return NULL;
101          }
102  
103          while ((line_ptr = f_read_line(f, "")) != NULL) {
104 <                if (sscanf(line_ptr, "%*s %lld kB", &value) != 2) {
104 >                if (sscanf(line_ptr, "%*s %llu kB", &value) != 1) {
105                          continue;
106                  }
107                  value *= 1024;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines