diff options
| author | alex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-12-04 10:20:40 +0000 |
|---|---|---|
| committer | alex <alex@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2006-12-04 10:20:40 +0000 |
| commit | 11579a31fd513f9956a5e9ee477d313b6247421c (patch) | |
| tree | d1d5bf1c374b4eaed6b0ad7eaa37f060e59abf72 /src/libs/zbxsysinfo/common | |
| parent | eb826c0fe1ca64029d8cc10d5ddc52df6994ef43 (diff) | |
| download | zabbix-11579a31fd513f9956a5e9ee477d313b6247421c.tar.gz zabbix-11579a31fd513f9956a5e9ee477d313b6247421c.tar.xz zabbix-11579a31fd513f9956a5e9ee477d313b6247421c.zip | |
- fixed some compilation warnings (Alexei)
git-svn-id: svn://svn.zabbix.com/trunk@3564 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxsysinfo/common')
| -rw-r--r-- | src/libs/zbxsysinfo/common/common.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/libs/zbxsysinfo/common/common.c b/src/libs/zbxsysinfo/common/common.c index 9456d7e0..94b554e0 100644 --- a/src/libs/zbxsysinfo/common/common.c +++ b/src/libs/zbxsysinfo/common/common.c @@ -1270,16 +1270,21 @@ int EXECUTE_STR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT #endif /* _WINDOWS */ + zabbix_log(LOG_LEVEL_DEBUG, "Before"); /* We got EOL only */ if(cmd_result[0] == '\n' || cmd_result[0] == '\0') { return SYSINFO_RET_FAIL; } - for(i = len-1; i >= 0 && (cmd_result[i] == '\n' || cmd_result[i] == '\r' || cmd_result[i] == '\0'); i++) - { - cmd_result[i] = '\0'; - } + for(i=strlen(cmd_result); i>0; i--) + { + if(cmd_result[i] == '\n') + { + cmd_result[i] = '\0'; + break; + } + } SET_TEXT_RESULT(result, strdup(cmd_result)); |
