changeset 22069:150993c9d509

Part of a large patch from o_sukhodolsky to fix some build warnings. Refs #1344
author Richard Laager <rlaager@wiktel.com>
date Sun, 13 Jan 2008 20:50:53 +0000
parents a031a4fd6a7d
children 5130f2100fe1
files pidgin/gtkprefs.c
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkprefs.c	Sun Jan 13 20:48:56 2008 +0000
+++ b/pidgin/gtkprefs.c	Sun Jan 13 20:50:53 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);