Wed, 02 Oct 2019 18:01:33 -0400
Simplify some conditions.
| libpurple/protocols/irc/irc.c | file | annotate | diff | comparison | revisions | |
| libpurple/protocols/oscar/peer_proxy.c | file | annotate | diff | comparison | revisions |
--- a/libpurple/protocols/irc/irc.c Wed Oct 02 17:58:38 2019 -0400 +++ b/libpurple/protocols/irc/irc.c Wed Oct 02 18:01:33 2019 -0400 @@ -766,8 +766,9 @@ while (start < len && line[start] == '\0') ++start; - if (len - start > 0) + if (start < len) { irc_parse_msg(irc, line + start); + } g_free(line);
--- a/libpurple/protocols/oscar/peer_proxy.c Wed Oct 02 17:58:38 2019 -0400 +++ b/libpurple/protocols/oscar/peer_proxy.c Wed Oct 02 18:01:33 2019 -0400 @@ -270,8 +270,7 @@ } /* If this frame has a payload then attempt to read it */ - if (frame->payload.len - frame->payload.offset > 0) - { + if (frame->payload.offset < frame->payload.len) { /* Read data into the temporary buffer until it is complete */ read = recv(conn->fd, &frame->payload.data[frame->payload.offset],