Skip to content

Commit

Permalink
Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
lucaderi committed May 14, 2024
1 parent 6c8198e commit d9fad2c
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions src/SNMP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,7 @@ void SNMP::send_snmpv1v2c_request(char *agent_host, char *community,
pdu_type = SNMP_MSG_GETNEXT;
break;
case snmp_get_bulk_pdu:
pdu_type =
(version == 0 /* SNMPv1 */) ? SNMP_MSG_GETNEXT : SNMP_MSG_GETBULK;
pdu_type = (version == 0 /* SNMPv1 */) ? SNMP_MSG_GETNEXT : SNMP_MSG_GETBULK;
break;
case snmp_set_pdu:
pdu_type = SNMP_MSG_SET;
Expand All @@ -333,8 +332,9 @@ void SNMP::send_snmpv1v2c_request(char *agent_host, char *community,
size_t name_length = MAX_OID_LEN;
oid name[MAX_OID_LEN];

if (snmp_parse_oid(_oid[i], name, &name_length))
if (snmp_parse_oid(_oid[i], name, &name_length)) {
snmp_add_null_var(pdu, name, name_length);
}
} else
break;
}
Expand Down Expand Up @@ -818,16 +818,14 @@ void SNMP::snmp_fetch_responses(lua_State *vm, u_int sec_timeout) {
char *sender_host, *oid_str, *value_str = NULL;
int sender_port, len;

len =
receive_udp_datagram(buf, BUFLEN, udp_sock, &sender_host, &sender_port);
len = receive_udp_datagram(buf, BUFLEN, udp_sock, &sender_host, &sender_port);

if ((message = snmp_parse_message(buf, len))) {
bool table_added = false;

i = 0;

while (
snmp_get_varbind_as_string(message, i, &oid_str, NULL, &value_str)) {
while(snmp_get_varbind_as_string(message, i, &oid_str, NULL, &value_str)) {
if (value_str /* && (value_str[0] != '\0') */) {
if (!table_added) lua_newtable(vm), table_added = true;

Expand Down

0 comments on commit d9fad2c

Please sign in to comment.