diff options
| author | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-14 19:16:56 +0000 |
|---|---|---|
| committer | hugetoad <hugetoad@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-11-14 19:16:56 +0000 |
| commit | b4ebcb38fdaac5c102fd0a9eef8f4be7e2e4e693 (patch) | |
| tree | 4959e54ad3c998496731e8236c5401a601f634c1 /src/libs | |
| parent | 8b3a821222ec9fb5437828f598063a29b8706a36 (diff) | |
Minor changes.
git-svn-id: svn://svn.zabbix.com/trunk@2315 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs')
| -rw-r--r-- | src/libs/zbxdbhigh/db.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/libs/zbxdbhigh/db.c b/src/libs/zbxdbhigh/db.c index 243d4d35..1c9bb702 100644 --- a/src/libs/zbxdbhigh/db.c +++ b/src/libs/zbxdbhigh/db.c @@ -867,7 +867,14 @@ void DBupdate_host_availability(int hostid,int available,int clock, char *error) zabbix_log(LOG_LEVEL_DEBUG,"In update_host_availability()"); - DBescape_string(error,error_esc,MAX_STRING_LEN); + if(error!=NULL) + { + DBescape_string(error,error_esc,MAX_STRING_LEN); + } + else + { + strscpy(error_esc,""); + } snprintf(sql,sizeof(sql)-1,"select available,disable_until from hosts where hostid=%d",hostid); zabbix_log(LOG_LEVEL_DEBUG,"SQL [%s]",sql); @@ -938,7 +945,14 @@ int DBupdate_item_status_to_notsupported(int itemid, char *error) zabbix_log(LOG_LEVEL_DEBUG,"In DBupdate_item_status_to_notsupported()"); - DBescape_string(error,error_esc,MAX_STRING_LEN); + if(error!=NULL) + { + DBescape_string(error,error_esc,MAX_STRING_LEN); + } + else + { + strscpy(error_esc,""); + } snprintf(sql,sizeof(sql)-1,"update items set status=%d,error='%s' where itemid=%d",ITEM_STATUS_NOTSUPPORTED,error_esc,itemid); zabbix_log(LOG_LEVEL_DEBUG,"SQL [%s]",sql); |
