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

Comparing projects/libstatgrab/src/libstatgrab/user_stats.c (file contents):
Revision 1.2 by tdb, Thu Feb 20 13:19:52 2003 UTC vs.
Revision 1.4 by pajs, Sat Mar 1 02:38:22 2003 UTC

# Line 21 | Line 21
21   #ifdef HAVE_CONFIG_H
22   #include "config.h"
23   #endif
24 < #include "statgrab.h"
24 >
25   #include <stdlib.h>
26   #include <stdio.h>
27   #include <string.h>
28 #ifdef FREEBSD
29 #include <sys/types.h>
30 #endif
28   #include <utmp.h>
29 + #include "statgrab.h"
30  
31   #define START_VAL 5
32  
# Line 43 | Line 41 | user_stat_t *get_user_stats(){
41  
42          /* First case call */
43          if (watermark==-1){
44 <                user_stat.name_list=malloc(START_VAL * sizeof *user_stat.name_list);
44 >                user_stat.name_list=malloc(START_VAL * sizeof(user_stat.name_list));
45                  if(user_stat.name_list==NULL){
46                          return NULL;
47                  }
# Line 55 | Line 53 | user_stat_t *get_user_stats(){
53                  if(entry->ut_type==USER_PROCESS) {
54                          if(num_users>watermark-1){
55                                  name_ptr=user_stat.name_list;
56 <                                if((user_stat.name_list=realloc(user_stat.name_list, (watermark*2* sizeof *user_stat.name_list)))==NULL){
56 >                                if((user_stat.name_list=realloc(user_stat.name_list, (watermark*2* sizeof(user_stat.name_list))))==NULL){
57                                          user_stat.name_list=name_ptr;
58                                          return NULL;
59                                  }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines