do not overflow type element

This commit is contained in:
marschap
2006-10-29 17:11:00 +00:00
parent 5b94bcb59e
commit 8777e016ca
5 changed files with 33 additions and 13 deletions
+27 -7
View File
@@ -4,22 +4,40 @@
#include "shared/LL.h"
typedef struct
{
unsigned long total, user, system, nice, idle;
unsigned long total;
unsigned long user;
unsigned long system;
unsigned long nice;
unsigned long idle;
} load_type;
typedef struct
{
char dev[256], type[64], mpoint[256];
long bsize, blocks, bfree, files, ffree;
} mounts_type;
typedef struct
{
int total, cache, buffers, free, shared;
char dev[256]; /*< device */
char type[64]; /*< file system type (as string) */
char mpoint[256]; /*< mount point */
long bsize; /*< transfer block size */
long blocks; /*< total data blocks in file system */
long bfree; /*< free blocks in fs */
long files; /*< total file nodes in file system */
long ffree; /*< free file nodes in fs */
} mounts_type;
typedef struct
{
int total;
int cache;
int buffers;
int free,;
int shared;
} meminfo_type;
typedef struct
{
char name[16];
@@ -27,6 +45,7 @@ typedef struct
int number;
} procinfo_type;
/* status definitions for network interfaces */
typedef enum {
down = 0,
@@ -61,6 +80,7 @@ typedef struct iface_info
double tr_pkt_old;
} IfaceInfo;
int machine_init();
int machine_close();
+1 -1
View File
@@ -199,7 +199,7 @@ int machine_get_fs(mounts_type fs[], int *cnt)
{
snprintf(fs[statcnt].dev, 255, "%s", pp->f_mntfromname);
snprintf(fs[statcnt].mpoint, 255, "%s", pp->f_mntonname);
snprintf(fs[statcnt].type, 255, "%s", pp->f_fstypename);
snprintf(fs[statcnt].type, 63, "%s", pp->f_fstypename);
fs[statcnt].blocks = pp->f_blocks;
if (fs[statcnt].blocks > 0)
+1 -1
View File
@@ -172,7 +172,7 @@ int machine_get_fs(mounts_type fs[], int *cnt)
{
snprintf(fs[statcnt].dev, 255, "%s", pp->f_mntfromname);
snprintf(fs[statcnt].mpoint, 255, "%s", pp->f_mntonname);
snprintf(fs[statcnt].type, 255, "%s", pp->f_fstypename);
snprintf(fs[statcnt].type, 63, "%s", pp->f_fstypename);
fs[statcnt].blocks = pp->f_blocks;
if (fs[statcnt].blocks > 0)
+2 -2
View File
@@ -165,9 +165,9 @@ int machine_get_fs(mounts_type fs[], int *cnt)
#endif
)
{
snprintf(fs[statcnt].dev, 255, "%s", pp->f_mntfromname);
snprintf(fs[statcnt].dev, 255, "%s", pp->f_mntfromname);
snprintf(fs[statcnt].mpoint, 255, "%s", pp->f_mntonname);
snprintf(fs[statcnt].type, 255, "%s", pp->f_fstypename);
snprintf(fs[statcnt].type, 63, "%s", pp->f_fstypename);
fs[statcnt].blocks = pp->f_blocks;
if (fs[statcnt].blocks > 0)
+2 -2
View File
@@ -170,9 +170,9 @@ int machine_get_fs(mounts_type fs[], int *cnt)
#endif
)
{
snprintf(fs[statcnt].dev, 255, "%s", pp->f_mntfromname);
snprintf(fs[statcnt].dev, 255, "%s", pp->f_mntfromname);
snprintf(fs[statcnt].mpoint, 255, "%s", pp->f_mntonname);
snprintf(fs[statcnt].type, 255, "%s", pp->f_fstypename);
snprintf(fs[statcnt].type, 63, "%s", pp->f_fstypename);
fs[statcnt].blocks = pp->f_blocks;
if (fs[statcnt].blocks > 0)