Mercurial > pidgin
diff libpurple/protocols/silc10/util.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 | ba1b50f114f6 |
children | 6de09629f091 |
line wrap: on
line diff
--- a/libpurple/protocols/silc10/util.c Sat Nov 03 17:04:25 2007 +0000 +++ b/libpurple/protocols/silc10/util.c Sat Nov 03 17:52:28 2007 +0000 @@ -79,7 +79,7 @@ pw = getpwuid(getuid()); if (!pw) { - purple_debug_error("silc", "silc: %s\n", strerror(errno)); + purple_debug_error("silc", "silc: %s\n", g_strerror(errno)); return FALSE; } @@ -108,7 +108,7 @@ return FALSE; } } else { - purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n", filename, strerror(errno)); + purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n", filename, g_strerror(errno)); return FALSE; } } else { @@ -140,7 +140,7 @@ } } else { purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n", - servfilename, strerror(errno)); + servfilename, g_strerror(errno)); return FALSE; } } @@ -163,7 +163,7 @@ } } else { purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n", - clientfilename, strerror(errno)); + clientfilename, g_strerror(errno)); return FALSE; } } @@ -186,7 +186,7 @@ } } else { purple_debug_error("silc", "Couldn't stat '%s' directory, error: %s\n", - friendsfilename, strerror(errno)); + friendsfilename, g_strerror(errno)); return FALSE; } } @@ -216,12 +216,12 @@ if ((g_stat(file_public_key, &st)) == -1) { purple_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n", - file_public_key, strerror(errno)); + file_public_key, g_strerror(errno)); return FALSE; } } else { purple_debug_error("silc", "Couldn't stat '%s' public key, error: %s\n", - file_public_key, strerror(errno)); + file_public_key, g_strerror(errno)); return FALSE; } } @@ -237,7 +237,7 @@ if ((fd = g_open(file_private_key, O_RDONLY, 0)) != -1) { if ((fstat(fd, &st)) == -1) { purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n", - file_private_key, strerror(errno)); + file_private_key, g_strerror(errno)); close(fd); return FALSE; } @@ -257,7 +257,7 @@ if ((fd = g_open(file_private_key, O_RDONLY, 0)) != -1) { if ((fstat(fd, &st)) == -1) { purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n", - file_private_key, strerror(errno)); + file_private_key, g_strerror(errno)); close(fd); return FALSE; } @@ -266,12 +266,12 @@ * will set the permissions */ else if ((g_stat(file_private_key, &st)) == -1) { purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n", - file_private_key, strerror(errno)); + file_private_key, g_strerror(errno)); return FALSE; } } else { purple_debug_error("silc", "Couldn't stat '%s' private key, error: %s\n", - file_private_key, strerror(errno)); + file_private_key, g_strerror(errno)); return FALSE; } }