comparison libpurple/protocols/gg/gg.c @ 21316:d0b16c09c2c4

Handle fwrite returning 0 in gg's "save my buddy list to a file" code, squashing a warning. (What's the point of this code given the various export/import plugins?)
author Will Thompson <will.thompson@collabora.co.uk>
date Sun, 11 Nov 2007 14:08:30 +0000
parents 6de09629f091
children 12d6b551fb6a 97dc2a474513 1ce05db42eb3
comparison
equal deleted inserted replaced
21314:8ae3eef4a27d 21316:d0b16c09c2c4
279 g_free(msg); 279 g_free(msg);
280 g_free(buddylist); 280 g_free(buddylist);
281 return; 281 return;
282 } 282 }
283 283
284 fwrite(buddylist, sizeof(char), g_utf8_strlen(buddylist, -1), fh); 284 if (!fwrite(buddylist, sizeof(char), g_utf8_strlen(buddylist, -1), fh)) {
285 const gchar *err = g_strerror(errno);
286 gchar *title = g_strdup_printf(
287 _("Couldn't write buddylist to %s"), err);
288
289 purple_debug_error("gg", "Error writing %s: %s\n", file, err);
290 purple_notify_error(account, title, title, err);
291
292 g_free(title);
293 } else {
294 purple_notify_info(account, _("Save Buddylist..."),
295 _("Buddylist saved successfully!"), NULL);
296 }
297
285 fclose(fh); 298 fclose(fh);
286 g_free(buddylist); 299 g_free(buddylist);
287
288 purple_notify_info(account, _("Save Buddylist..."),
289 _("Buddylist saved successfully!"), NULL);
290 } 300 }
291 /* }}} */ 301 /* }}} */
292 302
293 /* 303 /*
294 */ 304 */