Rename the variable to "error_status", as that's what it represents, and
as that doesn't collide with the error() function. Don't set it and
then not use the resulting value.
u_short pduid, const u_char *np, u_int length)
{
struct be elem;
u_short pduid, const u_char *np, u_int length)
{
struct be elem;
+ int count = 0, error_status;
/* reqId (Integer) */
if ((count = asn1_parse(ndo, np, length, &elem)) < 0)
/* reqId (Integer) */
if ((count = asn1_parse(ndo, np, length, &elem)) < 0)
asn1_print(ndo, &elem);
return;
}
asn1_print(ndo, &elem);
return;
}
if ((pduid == GETREQ || pduid == GETNEXTREQ || pduid == SETREQ
|| pduid == INFORMREQ || pduid == V2TRAP || pduid == REPORT)
&& elem.data.integer != 0) {
if ((pduid == GETREQ || pduid == GETNEXTREQ || pduid == SETREQ
|| pduid == INFORMREQ || pduid == V2TRAP || pduid == REPORT)
&& elem.data.integer != 0) {
} else if (elem.data.integer != 0) {
char errbuf[20];
ND_PRINT((ndo, " %s", DECODE_ErrorStatus(elem.data.integer)));
} else if (elem.data.integer != 0) {
char errbuf[20];
ND_PRINT((ndo, " %s", DECODE_ErrorStatus(elem.data.integer)));
- error = elem.data.integer;
+ error_status = elem.data.integer;
}
length -= count;
np += count;
}
length -= count;
np += count;
else if (pduid == GETBULKREQ)
ND_PRINT((ndo, " M=%d", elem.data.integer));
else if (elem.data.integer != 0) {
else if (pduid == GETBULKREQ)
ND_PRINT((ndo, " M=%d", elem.data.integer));
else if (elem.data.integer != 0) {
ND_PRINT((ndo, "[errorIndex(%d) w/o errorStatus]", elem.data.integer));
ND_PRINT((ndo, "[errorIndex(%d) w/o errorStatus]", elem.data.integer));
ND_PRINT((ndo, "@%d", elem.data.integer));
ND_PRINT((ndo, "@%d", elem.data.integer));
- error = elem.data.integer;
- }
- } else if (error) {
+ } else if (error_status) {
ND_PRINT((ndo, "[errorIndex==0]"));
ND_PRINT((ndo, "[errorIndex==0]"));
}
length -= count;
np += count;
}
length -= count;
np += count;