diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-07-12 09:14:46 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-07-12 09:14:46 +0000 |
| commit | 8a9f232945f6ec241470513933baf6d72d256a06 (patch) | |
| tree | 01c03798a9850c55f88a3e34db706a8786040482 /src/libs/zbxsysinfo/aix/memory.c | |
| parent | 62918b434f4f3c809505715d1d92c402110ab230 (diff) | |
| download | zabbix-8a9f232945f6ec241470513933baf6d72d256a06.tar.gz zabbix-8a9f232945f6ec241470513933baf6d72d256a06.tar.xz zabbix-8a9f232945f6ec241470513933baf6d72d256a06.zip | |
zabbix-1.2_dev integration
git-svn-id: svn://svn.zabbix.com/trunk@3038 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxsysinfo/aix/memory.c')
| -rw-r--r-- | src/libs/zbxsysinfo/aix/memory.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/libs/zbxsysinfo/aix/memory.c b/src/libs/zbxsysinfo/aix/memory.c index dab28847..9fe4d1b6 100644 --- a/src/libs/zbxsysinfo/aix/memory.c +++ b/src/libs/zbxsysinfo/aix/memory.c @@ -25,7 +25,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result) { #ifdef HAVE_PROC - FILE *f; + FILE *f = NULL; char *t; char c[MAX_STRING_LEN]; zbx_uint64_t res = 0; @@ -34,8 +34,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, init_result(result); - f=fopen("/proc/meminfo","r"); - if(NULL == f) + if( NULL == ( f = fopen("/proc/meminfo","r"))) { return SYSINFO_RET_FAIL; } @@ -56,7 +55,7 @@ static int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, break; } } - fclose(f); + zbx_fclose(f); SET_UI64_RESULT(result, res); return SYSINFO_RET_OK; @@ -387,7 +386,7 @@ MEM_FNCLIST return SYSINFO_RET_FAIL; } - if(get_param(param, 1, mode, MAX_STRING_LEN) != 0) + if(get_param(param, 1, mode, sizeof(mode)) != 0) { mode[0] = '\0'; } @@ -395,7 +394,7 @@ MEM_FNCLIST if(mode[0] == '\0') { /* default parameter */ - sprintf(mode, "total"); + zbx_snprintf(mode, sizeof(mode), "total"); } for(i=0; fl[i].mode!=0; i++) |
