diff pidgin/gtkprefs.c @ 22102:e6e018d0bf03

merge of '464169ffadabb173b3052074b132f38025b2e88d' and '88dc67220e1d61e540c931b9f27f5b4419809137'
author Richard Laager <rlaager@wiktel.com>
date Mon, 14 Jan 2008 04:09:03 +0000
parents 1d02fa7737eb 5130f2100fe1
children c77098cebf23
line wrap: on
line diff
--- a/pidgin/gtkprefs.c	Mon Jan 14 02:10:26 2008 +0000
+++ b/pidgin/gtkprefs.c	Mon Jan 14 04:09:03 2008 +0000
@@ -478,12 +478,20 @@
 {
 	FILE *f;
 	gchar *path;
+	size_t wc;
 
 	if ((error_message != NULL) || (len == 0))
 		return;
 
 	f = purple_mkstemp(&path, TRUE);
-	fwrite(themedata, len, 1, f);
+	wc = fwrite(themedata, len, 1, f);
+	if (wc != 1) {
+		purple_debug_warning("theme_got_url", "Unable to write theme data.\n");
+		fclose(f);
+		g_unlink(path);
+		g_free(path);
+		return;
+	}
 	fclose(f);
 
 	theme_install_theme(path, user_data);
@@ -1718,9 +1726,6 @@
 	int j;
 	const char *file;
 	char *pref;
-#if !defined _WIN32 || defined USE_GSTREAMER
-	GtkWidget *label;
-#endif
 #ifndef _WIN32
 	GtkWidget *dd;
 	GtkWidget *entry;