diff libpurple/buddyicon.c @ 21121:35b4f1dc4c8d

replace most calls to strerror with calls to g_strerror. strerror will return a locale-specific string in the locale-specific encoding, which isn't guaranteed to be UTF-8. g_strerror will always return a UTF-8 string. I left gg and zephyr untouched, since gg doesn't include glib headers yet, and zephyr does something weird with a #define for strerror. Someone more familliar with those should take a look. And the win32 guys should check and see if I screwed something up, since they had strerror #defined to something else. This should fix #2247 (and maybe some mystery crashes)
author Nathan Walp <nwalp@pidgin.im>
date Sat, 03 Nov 2007 17:52:28 +0000
parents 4d4eb6831722
children 837c382af6a4
line wrap: on
line diff
--- a/libpurple/buddyicon.c	Sat Nov 03 17:04:25 2007 +0000
+++ b/libpurple/buddyicon.c	Sat Nov 03 17:52:28 2007 +0000
@@ -116,7 +116,7 @@
 		{
 			purple_debug_error("buddyicon",
 			                   "Unable to create directory %s: %s\n",
-			                   dirname, strerror(errno));
+			                   dirname, g_strerror(errno));
 		}
 	}
 
@@ -125,7 +125,7 @@
 		if (!fwrite(purple_imgstore_get_data(img), purple_imgstore_get_size(img), 1, file))
 		{
 			purple_debug_error("buddyicon", "Error writing %s: %s\n",
-			                   path, strerror(errno));
+			                   path, g_strerror(errno));
 		}
 		else
 			purple_debug_info("buddyicon", "Wrote cache file: %s\n", path);
@@ -135,7 +135,7 @@
 	else
 	{
 		purple_debug_error("buddyicon", "Unable to create file %s: %s\n",
-		                   path, strerror(errno));
+		                   path, g_strerror(errno));
 		g_free(path);
 		return;
 	}
@@ -163,7 +163,7 @@
 		if (g_unlink(path))
 		{
 			purple_debug_error("buddyicon", "Failed to delete %s: %s\n",
-			                   path, strerror(errno));
+			                   path, g_strerror(errno));
 		}
 		else
 		{
@@ -951,7 +951,7 @@
 			if (!fwrite(icon_data, icon_len, 1, file))
 			{
 				purple_debug_error("buddyicon", "Error writing %s: %s\n",
-				                   path, strerror(errno));
+				                   path, g_strerror(errno));
 			}
 			else
 				purple_debug_info("buddyicon", "Wrote migrated cache file: %s\n", path);
@@ -961,7 +961,7 @@
 		else
 		{
 			purple_debug_error("buddyicon", "Unable to create file %s: %s\n",
-			                   path, strerror(errno));
+			                   path, g_strerror(errno));
 			g_free(new_filename);
 			g_free(path);
 
@@ -1056,7 +1056,7 @@
 			{
 				purple_debug_error("buddyicon",
 				                   "Unable to create directory %s: %s\n",
-				                   dirname, strerror(errno));
+				                   dirname, g_strerror(errno));
 			}
 		}
 	}