goffice r2214 - in trunk: . goffice/app goffice/graph



Author: jody
Date: Fri Sep 12 13:30:20 2008
New Revision: 2214
URL: http://svn.gnome.org/viewvc/goffice?rev=2214&view=rev

Log:
2008-09-11  Jody Goldberg <jody gnome org>

	* goffice/app/go-doc.c (load_image) : Check for missing "name"
	  attribute not no attributes at all. [Coverity 196]

Modified:
   trunk/ChangeLog
   trunk/goffice/app/go-doc.c
   trunk/goffice/graph/gog-axis.c

Modified: trunk/goffice/app/go-doc.c
==============================================================================
--- trunk/goffice/app/go-doc.c	(original)
+++ trunk/goffice/app/go-doc.c	Fri Sep 12 13:30:20 2008
@@ -423,7 +423,7 @@
 	xmlChar const **attr = 	attrs;
 	while (*attr && strcmp (*attr, "name"))
 		attr += 2;
-	if (!attr)
+	if (!*attr)
 		return;
 	image = (GOImage *) g_hash_table_lookup (doc->imagebuf, attr[1]);
 	if (!image) /* this should not occur, but if it does, we might want to load the image? */

Modified: trunk/goffice/graph/gog-axis.c
==============================================================================
--- trunk/goffice/graph/gog-axis.c	(original)
+++ trunk/goffice/graph/gog-axis.c	Fri Sep 12 13:30:20 2008
@@ -734,11 +734,11 @@
 
 #ifdef GOFFICE_WITH_GTK
 static void
-gog_axis_map_set_by_num (GogAxis *axis, unsigned num)
+gog_axis_map_set_by_num (GogAxis *axis, gint num)
 {
 	g_return_if_fail (IS_GOG_AXIS (axis));
 
-	if (num >= 0 && num < G_N_ELEMENTS (map_descs))
+	if (num >= 0 && num < (gint)G_N_ELEMENTS (map_descs))
 		g_object_set (G_OBJECT (axis), "map-name", map_descs[num].name, NULL);
 	else
 		g_object_set (G_OBJECT (axis), "map-name", "", NULL);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]