changeset 2639:4d6a767133e1

[gaim-migrate @ 2652] hi. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 31 Oct 2001 09:18:11 +0000
parents dec3c9d4181d
children cbc5c3861f77
files src/protocols/oscar/im.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/oscar/im.c	Tue Oct 30 20:09:13 2001 +0000
+++ b/src/protocols/oscar/im.c	Wed Oct 31 09:18:11 2001 +0000
@@ -89,8 +89,10 @@
 	fu32_t sum;
 	int i;
 
-	for (i = 0, sum = 0; i < buflen; i += 2)
+	for (i = 0, sum = 0; i + 1 < buflen; i += 2)
 		sum += (buf[i+1] << 8) + buf[i];
+	if (i < buflen)
+		sum += buf[i];
 
 	sum = ((sum & 0xffff0000) >> 16) + (sum & 0x0000ffff);