|| (vl->type == ASN_GAUGE))
{
temp = (uint32_t) *vl->val.integer;
- DEBUG ("snmp plugin: Parsed int32 value is %llu.", temp);
+ DEBUG ("snmp plugin: Parsed int32 value is %"PRIu64".", temp);
}
else if (vl->type == ASN_COUNTER64)
{
temp = (uint32_t) vl->val.counter64->high;
temp = temp << 32;
temp += (uint32_t) vl->val.counter64->low;
- DEBUG ("snmp plugin: Parsed int64 value is %llu.", temp);
+ DEBUG ("snmp plugin: Parsed int64 value is %"PRIu64".", temp);
}
else if (vl->type == ASN_OCTET_STR)
{
if (instance_len > vb->val_len)
instance_len = vb->val_len;
+ if (instance_len < 1)
+ {
+ ERROR ("snmp plugin: csnmp_instance_list_add: instance_len = %zu, "
+ "which is less than one.", instance_len);
+ sfree (il);
+ return (-1);
+ }
+
sstrncpy (il->instance, (char *) ((vb->type == ASN_OCTET_STR)
? vb->val.string
: vb->val.bitstring),
if ((time_end - time_start) > host->interval)
{
WARNING ("snmp plugin: Host `%s' should be queried every %i seconds, "
- "but reading all values takes %lu seconds.",
- host->name, host->interval, (unsigned long)(time_end - time_start));
+ "but reading all values takes %u seconds.",
+ host->name, host->interval, (unsigned int) (time_end - time_start));
}
return (0);