Simplify some conditions.

Wed, 02 Oct 2019 18:01:33 -0400

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Wed, 02 Oct 2019 18:01:33 -0400
changeset 39917
45dbd7582a5a
parent 39916
6a79856cb8f5
child 39918
1c8e11f9274f

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],

mercurial