# HG changeset patch # User Daniel Atallah # Date 1114400476 0 # Node ID 4a56b48dbaa6a901ee9c45fe98eb8ccf20e3bac3 # Parent 5727afad0fb8956242ad1bf5aa9d510428e07ef0 [gaim-migrate @ 12555] Don't try to send if charset conversion isn't successful. This is entirely untested. committer: Tailor Script diff -r 5727afad0fb8 -r 4a56b48dbaa6 src/protocols/gg/gg.c --- a/src/protocols/gg/gg.c Mon Apr 25 01:53:01 2005 +0000 +++ b/src/protocols/gg/gg.c Mon Apr 25 03:41:16 2005 +0000 @@ -1,6 +1,6 @@ /* * gaim - Gadu-Gadu Protocol Plugin - * $Id: gg.c 12546 2005-04-24 20:49:55Z thekingant $ + * $Id: gg.c 12555 2005-04-25 03:41:16Z datallah $ * * Copyright (C) 2001 Arkadiusz Mi¶kiewicz * @@ -936,7 +936,6 @@ static int agg_send_im(GaimConnection *gc, const char *who, const char *msg, GaimConvImFlags flags) { struct agg_data *gd = (struct agg_data *)gc->proto_data; - gchar *imsg; if (invalid_uin(who)) { gaim_notify_error(gc, NULL, @@ -946,11 +945,14 @@ } if (strlen(msg) > 0) { - imsg = charset_convert(msg, "UTF-8", "CP1250"); - if (gg_send_message(gd->sess, GG_CLASS_CHAT, + gchar *imsg = charset_convert(msg, "UTF-8", "CP1250"); + if (imsg != NULL && strlen(imsg) > 0) { + if (gg_send_message(gd->sess, GG_CLASS_CHAT, strtol(who, (char **)NULL, 10), imsg) < 0) - return -1; - g_free(imsg); + return -1; + } + if (imsg != NULL) + g_free(imsg); } return 1; }