diff --git a/src/osysmon_openvpn.c b/src/osysmon_openvpn.c index 3c03099..5d9af8a 100644 --- a/src/osysmon_openvpn.c +++ b/src/osysmon_openvpn.c @@ -98,25 +98,24 @@ static char *parse_state(struct msgb *msg, struct openvpn_client *vpn) } for (tok = strtok(tmp, ","), i = 0; tok && i < MAX_RESP_COMPONENTS; tok = strtok(NULL, ",")) { - if (tok) { /* Parse csv string and pick interesting tokens while ignoring the rest. */ - switch (i++) { - /* case 0: unix/date time, not needed */ - case 1: - update_name(vpn->rem_cfg, tok); - break; - case 2: - snprintf(buf, sizeof(buf), "%s (%s)", vpn->rem_cfg->name, tok); - update_name(vpn->rem_cfg, buf); - case 3: - osmo_talloc_replace_string(vpn->rem_cfg, &vpn->tun_ip, tok); - break; - case 4: - update_host(vpn->rem_cfg, tok); - break; - case 5: - vpn->rem_cfg->remote_port = atoi(tok); - break; - } + /* Parse csv string and pick interesting tokens while ignoring the rest. */ + switch (i++) { + /* case 0: unix/date time, not needed */ + case 1: + update_name(vpn->rem_cfg, tok); + break; + case 2: + snprintf(buf, sizeof(buf), "%s (%s)", vpn->rem_cfg->name, tok); + update_name(vpn->rem_cfg, buf); + case 3: + osmo_talloc_replace_string(vpn->rem_cfg, &vpn->tun_ip, tok); + break; + case 4: + update_host(vpn->rem_cfg, tok); + break; + case 5: + vpn->rem_cfg->remote_port = atoi(tok); + break; } } return NULL;