Fix the -Wconversion warnings produced when compiling the SNMP agent.

This commit is contained in:
Shteryana Shopova 2013-10-17 12:03:17 +00:00
parent 0698344859
commit 546401ce54

View file

@ -276,7 +276,12 @@ snmp_get(struct snmp_pdu *pdu, struct asn_buf *resp_b,
}
}
return (snmp_fix_encoding(resp_b, resp));
if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) {
snmp_debug("get: failed to encode PDU");
return (SNMP_RET_ERR);
}
return (SNMP_RET_OK);
}
static struct snmp_node *
@ -438,7 +443,13 @@ snmp_getnext(struct snmp_pdu *pdu, struct asn_buf *resp_b,
return (SNMP_RET_ERR);
}
}
return (snmp_fix_encoding(resp_b, resp));
if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) {
snmp_debug("getnext: failed to encode PDU");
return (SNMP_RET_ERR);
}
return (SNMP_RET_OK);
}
enum snmp_ret
@ -537,7 +548,12 @@ snmp_getbulk(struct snmp_pdu *pdu, struct asn_buf *resp_b,
}
done:
return (snmp_fix_encoding(resp_b, resp));
if (snmp_fix_encoding(resp_b, resp) != SNMP_CODE_OK) {
snmp_debug("getnext: failed to encode PDU");
return (SNMP_RET_ERR);
}
return (SNMP_RET_OK);
}
/*