Mercurial > pidgin.yaz
changeset 21317:84925e6055bc
Use distinct variables for the result of g_strerror (which is const) and a
g_strdup_printf (which is not), squashing a warning in sametime.
author | Will Thompson <will.thompson@collabora.co.uk> |
---|---|
date | Sun, 11 Nov 2007 14:10:06 +0000 |
parents | d0b16c09c2c4 |
children | 9bbb0950fa73 |
files | libpurple/protocols/sametime/sametime.c |
diffstat | 1 files changed, 6 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/sametime/sametime.c Sun Nov 11 14:08:30 2007 +0000 +++ b/libpurple/protocols/sametime/sametime.c Sun Nov 11 14:10:06 2007 +0000 @@ -1702,11 +1702,12 @@ purple_connection_error(pd->gc, _("Connection reset")); } else if(ret < 0) { - char *msg = g_strerror(err); - - DEBUG_INFO("error in read callback: %s\n", msg); - - msg = g_strdup_printf(_("Error reading from socket: %s"), msg); + const gchar *err_str = g_strerror(err); + char *msg = NULL; + + DEBUG_INFO("error in read callback: %s\n", err_str); + + msg = g_strdup_printf(_("Error reading from socket: %s"), err_str); purple_connection_error(pd->gc, msg); g_free(msg); }