Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/clock/ChangeLog,v
retrieving revision 1.523
diff -u -p -r1.523 ChangeLog
--- ChangeLog	9 Mar 2004 19:35:00 -0000	1.523
+++ ChangeLog	11 Mar 2004 10:53:04 -0000
@@ -0,0 +1,5 @@
+2004-03-11  Mark McLoughlin  <mark@skynet.ie>
+
+	* clock.c: (fill_clock_applet): don't assume enums
+	use a signed representation. Fixes crasher bug #136721.
+
Index: clock.c
===================================================================
RCS file: /cvs/gnome/gnome-panel/applets/clock/clock.c,v
retrieving revision 1.135
diff -u -p -r1.135 clock.c
--- clock.c	5 Mar 2004 16:18:24 -0000	1.135
+++ clock.c	11 Mar 2004 10:53:05 -0000
@@ -85,7 +85,8 @@ static const char *clock_config_tools []
 
 /* Needs to match the indices in the combo */
 typedef enum {
-	CLOCK_FORMAT_12 = 0,
+        CLOCK_FORMAT_INVALID = 0,
+	CLOCK_FORMAT_12,
 	CLOCK_FORMAT_24,
 	CLOCK_FORMAT_UNIX,
 	CLOCK_FORMAT_INTERNET,
@@ -1876,8 +1877,8 @@ fill_clock_applet (PanelApplet *applet)
 	ClockData         *cd;
 	BonoboUIComponent *popup_component;
 	GError            *error;
+        int                format;
 	char              *format_str;
-	int                format_int;
 	char              *config_tool;
 	
 	panel_applet_add_preferences (applet, "/schemas/apps/clock_applet/prefs", NULL);
@@ -1891,23 +1892,19 @@ fill_clock_applet (PanelApplet *applet)
 
 	setup_gconf (cd);
 
+        cd->format = CLOCK_FORMAT_INVALID;
+
 	format_str = panel_applet_gconf_get_string (applet, KEY_FORMAT, NULL);
-	if (format_str) {
-		format_int = -1;
-		gconf_string_to_enum (format_type_enum_map,
-				      format_str,
-				      &format_int);
-		cd->format = format_int;
-		g_free (format_str);
-	} else {
-		cd->format = -1;
+	if (format_str &&
+            gconf_string_to_enum (format_type_enum_map, format_str, &format))
+                cd->format = format;
+	else
 		clock_migrate_to_26 (cd);
-	}
 
-	if (cd->format < 0) {
-		/* if value is not set, set it according to locale */
+        g_free (format_str);
+
+	if (cd->format == CLOCK_FORMAT_INVALID)
 		cd->format = clock_locale_format ();
-	}
 
 	cd->custom_format = panel_applet_gconf_get_string (applet, KEY_CUSTOM_FORMAT, NULL);
 	cd->showseconds = panel_applet_gconf_get_bool (applet, KEY_SHOW_SECONDS, NULL);
