changeset 21319:85fbadb8b8fd

merge of '2fb075583d4e52527a1045112f38c7a76f2c7e80' and '69e2383bb3023269544a242c2538d711fd64d416'
author Will Thompson <will.thompson@collabora.co.uk>
date Sun, 11 Nov 2007 14:18:23 +0000
parents 9a240e6415d8 (current diff) 9bbb0950fa73 (diff)
children bd40356b8b37 12d6b551fb6a eb53ce4852a6 1ce05db42eb3
files
diffstat 3 files changed, 21 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/gg/gg.c	Sun Nov 11 14:02:01 2007 +0000
+++ b/libpurple/protocols/gg/gg.c	Sun Nov 11 14:18:23 2007 +0000
@@ -281,12 +281,22 @@
 		return;
 	}
 
-	fwrite(buddylist, sizeof(char), g_utf8_strlen(buddylist, -1), fh);
+	if (!fwrite(buddylist, sizeof(char), g_utf8_strlen(buddylist, -1), fh)) {
+		const gchar *err = g_strerror(errno);
+		gchar *title = g_strdup_printf(
+			_("Couldn't write buddylist to %s"), err);
+
+		purple_debug_error("gg", "Error writing %s: %s\n", file, err);
+		purple_notify_error(account, title, title, err);
+
+		g_free(title);
+	} else {
+		purple_notify_info(account, _("Save Buddylist..."),
+			 _("Buddylist saved successfully!"), NULL);
+	}
+
 	fclose(fh);
 	g_free(buddylist);
-
-	purple_notify_info(account, _("Save Buddylist..."),
-			 _("Buddylist saved successfully!"), NULL);
 }
 /* }}} */
 
--- a/libpurple/protocols/sametime/sametime.c	Sun Nov 11 14:02:01 2007 +0000
+++ b/libpurple/protocols/sametime/sametime.c	Sun Nov 11 14:18:23 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);
   }
--- a/libpurple/xmlnode.c	Sun Nov 11 14:02:01 2007 +0000
+++ b/libpurple/xmlnode.c	Sun Nov 11 14:18:23 2007 +0000
@@ -590,7 +590,7 @@
 		}
 
 		for(i=0; i < nb_attributes * 5; i+=5) {
-			const char *prefix = attributes[i + 1];
+			const char *prefix = (const char *)attributes[i + 1];
 			char *txt;
 			int attrib_len = attributes[i+4] - attributes[i+3];
 			char *attrib = g_malloc(attrib_len + 1);