pidgin: fff08980: gah, signed comparison meant this was st...

darkrain42 at pidgin.im darkrain42 at pidgin.im
Mon Aug 31 04:05:34 EDT 2009


-----------------------------------------------------------------
Revision: fff08980f18a8b4ce7302669680621243d2b8853
Ancestor: 1da86e1cd93c4caa53982499eadf7e18e976f1d5
Author: darkrain42 at pidgin.im
Date: 2009-08-31T08:00:06
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/fff08980f18a8b4ce7302669680621243d2b8853

Modified files:
        libpurple/util.c

ChangeLog: 

gah, signed comparison meant this was stripping all multibyte UTF-8 characters.

Thanks a bunch to SuperMMX for pointing this out.

-------------- next part --------------
============================================================
--- libpurple/util.c	a5e31764cf185f8ab9b302693ef008b43d09def3
+++ libpurple/util.c	7f802846790ce68ad5ad96eee784c695084bd601
@@ -4670,8 +4670,9 @@ purple_utf8_strip_unprintables(const gch
 
 	workstr = iter = g_new(gchar, strlen(str) + 1);
 	for ( ; *str; ++str) {
-		if (*str >= 0x20 || *str == '\t' || *str == '\n' || *str == '\r') {
-			*iter = *str;
+		guchar c = *str;
+		if (c >= 0x20 || c == '\t' || c == '\n' || c == '\r') {
+			*iter = c;
 			++iter;
 		}
 	}


More information about the Commits mailing list