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 |
|
|
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 |
|
} |
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 |
|
} |