aboutsummaryrefslogtreecommitdiffstats
path: root/lib/egg
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-10-03 17:19:36 +0800
committerChristian Persch <chpe@src.gnome.org>2003-10-03 17:19:36 +0800
commit2ab70ea439d3b0001d1d01e1e79d07bc4bb99d41 (patch)
treef99556f8b5947e8b92a4f52a4aebd76f5e798439 /lib/egg
parentb4ace448b09daa5d7220acdf9b59655baec2c63d (diff)
downloadgsoc2013-epiphany-2ab70ea439d3b0001d1d01e1e79d07bc4bb99d41.tar
gsoc2013-epiphany-2ab70ea439d3b0001d1d01e1e79d07bc4bb99d41.tar.gz
gsoc2013-epiphany-2ab70ea439d3b0001d1d01e1e79d07bc4bb99d41.tar.bz2
gsoc2013-epiphany-2ab70ea439d3b0001d1d01e1e79d07bc4bb99d41.tar.lz
gsoc2013-epiphany-2ab70ea439d3b0001d1d01e1e79d07bc4bb99d41.tar.xz
gsoc2013-epiphany-2ab70ea439d3b0001d1d01e1e79d07bc4bb99d41.tar.zst
gsoc2013-epiphany-2ab70ea439d3b0001d1d01e1e79d07bc4bb99d41.zip
Check for failed load of the toolbars model from the XML file, and fix the
2003-10-03 Christian Persch <chpe@cvs.gnome.org> * lib/egg/egg-toolbars-model.c: (safe_save_xml), (egg_toolbars_model_load): Check for failed load of the toolbars model from the XML file, and fix the check for failed save of same to the XML file.
Diffstat (limited to 'lib/egg')
-rwxr-xr-xlib/egg/egg-toolbars-model.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c
index fc74aa174..091604087 100755
--- a/lib/egg/egg-toolbars-model.c
+++ b/lib/egg/egg-toolbars-model.c
@@ -146,7 +146,7 @@ safe_save_xml (const char *xml_file, xmlDocPtr doc)
tmp_file = g_strconcat (xml_file, ".tmp", NULL);
old_file = g_strconcat (xml_file, ".old", NULL);
- if (!xmlSaveFormatFile (tmp_file, doc, 1))
+ if (xmlSaveFormatFile (tmp_file, doc, 1) <= 0)
{
g_warning ("Failed to write XML data to %s", tmp_file);
goto failed;
@@ -441,6 +441,11 @@ egg_toolbars_model_load (EggToolbarsModel *t,
g_return_if_fail (IS_EGG_TOOLBARS_MODEL (t));
doc = xmlParseFile (xml_file);
+ if (doc == NULL)
+ {
+ g_warning ("Failed to load XML data from %s", xml_file);
+ return;
+ }
root = xmlDocGetRootElement (doc);
t->priv->toolbars = g_node_new (NULL);