Skip to content

Commit

Permalink
Linux build fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nemosminer authored Apr 7, 2018
1 parent 37c9a72 commit 9dcea92
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1252,7 +1252,7 @@ static void api()
char *wskey = NULL;
n = recv(c, &buf[0], SOCK_REC_BUFSZ, 0);

fail = SOCKETFAIL(n);
fail = SOCKETFAIL(n) || n < 0;
if (fail)
buf[0] = '\0';
else if (n > 0 && buf[n-1] == '\n') {
Expand All @@ -1261,7 +1261,7 @@ static void api()
if (n > 0 && buf[n-1] == '\r')
buf[n-1] = '\0';
}
buf[n] = '\0';
else buf[n] = '\0';

//if (opt_debug && opt_protocol && n > 0)
// applog(LOG_DEBUG, "API: recv command: (%d) '%s'+char(%x)", n, buf, buf[n-1]);
Expand Down

0 comments on commit 9dcea92

Please sign in to comment.