Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
oncp_connect: avoid code without side-effects
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
  • Loading branch information
Nikos Mavrogiannopoulos authored and nmav committed Nov 17, 2020
1 parent 512a9ce commit 04fe9d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions oncp.c
Expand Up @@ -780,12 +780,12 @@ int oncp_connect(struct openconnect_info *vpninfo)
vpn_progress(vpninfo, PRG_DEBUG, _("oNCP negotiation request outgoing:\n"));
dump_buf_hex(vpninfo, PRG_DEBUG, '>', (void *)reqbuf->data, reqbuf->pos);
ret = vpninfo->ssl_write(vpninfo, reqbuf->data, reqbuf->pos);
if (ret == reqbuf->pos)
ret = 0;
else if (ret >= 0) {
vpn_progress(vpninfo, PRG_ERR,
_("Short write in oNCP negotiation\n"));
ret = -EIO;
if (ret != reqbuf->pos) {
if (ret >= 0) {
vpn_progress(vpninfo, PRG_ERR,
_("Short write in oNCP negotiation\n"));
ret = -EIO;
}
goto out;
}

Expand Down

0 comments on commit 04fe9d1

Please sign in to comment.