changeset 21831:543306932d15

Make yahoo_html_to_codes deal with ' in messages being sent. Also correct the size parameter passed to strncmp for various other entities to actually match the right length (previously only "&quo" was being checked to match, for example).
author Will Thompson <will.thompson@collabora.co.uk>
date Sun, 16 Dec 2007 16:36:53 +0000
parents f2cf1d61a676
children 5c702ff46072
files libpurple/protocols/yahoo/util.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/util.c	Sat Dec 15 18:23:04 2007 +0000
+++ b/libpurple/protocols/yahoo/util.c	Sun Dec 16 16:36:53 2007 +0000
@@ -715,12 +715,15 @@
 			} else if (((len - i) >= 4) && !strncmp(&src[i], "&gt;", 4)) {
 				g_string_append_c(dest, '>');
 				i += 3;
-			} else if (((len - i) >= 5) && !strncmp(&src[i], "&amp;", 4)) {
+			} else if (((len - i) >= 5) && !strncmp(&src[i], "&amp;", 5)) {
 				g_string_append_c(dest, '&');
 				i += 4;
-			} else if (((len - i) >= 6) && !strncmp(&src[i], "&quot;", 4)) {
+			} else if (((len - i) >= 6) && !strncmp(&src[i], "&quot;", 6)) {
 				g_string_append_c(dest, '"');
 				i += 5;
+			} else if (((len - i) >= 6) && !strncmp(&src[i], "&apos;", 6)) {
+				g_string_append_c(dest, '\'');
+				i += 5;
 			} else {
 				g_string_append_c(dest, src[i]);
 			}