# HG changeset patch # User Ethan Blanton # Date 1166113129 0 # Node ID 5ab90cdee9e56c5be91a521e5b3f5070a9be1b8e # Parent 1df707ddf05647374a1336fe8aae4752743412f4 [gaim-migrate @ 17997] If a buddy icon cannot be retrieved from a conversation, or if the buddy icon write to disk fails to complete, unlink the icon file and abort. This silences a warning, and is more correct to boot. committer: Tailor Script diff -r 1df707ddf056 -r 5ab90cdee9e5 gtk/gtkconv.c --- a/gtk/gtkconv.c Thu Dec 14 05:56:50 2006 +0000 +++ b/gtk/gtkconv.c Thu Dec 14 16:18:49 2006 +0000 @@ -2404,13 +2404,12 @@ icon = gaim_conv_im_get_icon(GAIM_CONV_IM(conv)); data = gaim_buddy_icon_get_data(icon, &len); - if ((len <= 0) || (data == NULL)) { + if ((len <= 0) || (data == NULL) || (fwrite(data, 1, len, fp) != 1)) { gaim_notify_error(gtkconv, NULL, _("Unable to save icon file to disk."), NULL); fclose(fp); + g_unlink(filename); return; } - - fwrite(data, 1, len, fp); fclose(fp); }