changeset 2813:bda5b89ba2f9

[gaim-migrate @ 2826] helps to nul-terminate strings. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Thu, 29 Nov 2001 08:39:55 +0000
parents 90ccd9a2b7bb
children f4f9e5a01890
files src/protocols/yahoo/yahoo.c
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Thu Nov 29 08:36:31 2001 +0000
+++ b/src/protocols/yahoo/yahoo.c	Thu Nov 29 08:39:55 2001 +0000
@@ -479,12 +479,15 @@
 		m = msg;
 		for (i = 0, j = 0; m[i]; i++) {
 			if (m[i] == 033) {
-				while (m[i] != 'm')
+				while (m[i] && (m[i] != 'm'))
 					i++;
+				if (!m[i])
+					i--;
 				continue;
 			}
 			msg[j++] = m[i];
 		}
+		msg[j] = 0;
 		serv_got_im(gc, from, msg, 0, tm);
 	} else if (pkt->status == 2) {
 		do_error_dialog(_("Your message did not get sent."), _("Gaim - Error"));