comparison libpurple/protocols/sametime/sametime.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 3cc856ca2338
children 6de09629f091
comparison
equal deleted inserted replaced
21120:0cc12e6909e2 21121:35b4f1dc4c8d
1700 if(! ret) { 1700 if(! ret) {
1701 DEBUG_INFO("connection reset\n"); 1701 DEBUG_INFO("connection reset\n");
1702 purple_connection_error(pd->gc, _("Connection reset")); 1702 purple_connection_error(pd->gc, _("Connection reset"));
1703 1703
1704 } else if(ret < 0) { 1704 } else if(ret < 0) {
1705 char *msg = strerror(err); 1705 char *msg = g_strerror(err);
1706 1706
1707 DEBUG_INFO("error in read callback: %s\n", msg); 1707 DEBUG_INFO("error in read callback: %s\n", msg);
1708 1708
1709 msg = g_strdup_printf(_("Error reading from socket: %s"), msg); 1709 msg = g_strdup_printf(_("Error reading from socket: %s"), msg);
1710 purple_connection_error(pd->gc, msg); 1710 purple_connection_error(pd->gc, msg);
2165 mwFileTransfer_send(ft, &o); 2165 mwFileTransfer_send(ft, &o);
2166 2166
2167 } else { 2167 } else {
2168 int err = errno; 2168 int err = errno;
2169 DEBUG_WARN("problem reading from file %s: %s\n", 2169 DEBUG_WARN("problem reading from file %s: %s\n",
2170 NSTR(mwFileTransfer_getFileName(ft)), strerror(err)); 2170 NSTR(mwFileTransfer_getFileName(ft)), g_strerror(err));
2171 2171
2172 mwFileTransfer_cancel(ft); 2172 mwFileTransfer_cancel(ft);
2173 } 2173 }
2174 } 2174 }
2175 2175
5007 5007
5008 /* test that we can actually send the file */ 5008 /* test that we can actually send the file */
5009 fp = g_fopen(filename, "rb"); 5009 fp = g_fopen(filename, "rb");
5010 if(! fp) { 5010 if(! fp) {
5011 char *msg = g_strdup_printf(_("Error reading file %s: \n%s\n"), 5011 char *msg = g_strdup_printf(_("Error reading file %s: \n%s\n"),
5012 filename, strerror(errno)); 5012 filename, g_strerror(errno));
5013 purple_xfer_error(purple_xfer_get_type(xfer), acct, xfer->who, msg); 5013 purple_xfer_error(purple_xfer_get_type(xfer), acct, xfer->who, msg);
5014 g_free(msg); 5014 g_free(msg);
5015 return; 5015 return;
5016 } 5016 }
5017 fclose(fp); 5017 fclose(fp);