2009-03-05 Claudio Saavedra <csaavedra@igalia.com>
authorClaudio Saavedra <csaavedra@igalia.com>
Thu, 5 Mar 2009 14:47:36 +0000 (14:47 +0000)
committerClaudio Saavedra <csaavedra@igalia.com>
Thu, 5 Mar 2009 14:47:36 +0000 (14:47 +0000)
* src/hildon-time-editor.c
(hildon_time_editor_get_time_separators): Do not crash if
the first label is NULL.

ChangeLog
src/hildon-time-editor.c

index 1544b58..d7a9e1f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-03-05  Claudio Saavedra  <csaavedra@igalia.com>
 
+       * src/hildon-time-editor.c
+       (hildon_time_editor_get_time_separators): Do not crash if
+       the first label is NULL.
+
+2009-03-05  Claudio Saavedra  <csaavedra@igalia.com>
+
        * src/hildon-date-selector.c (_month_days): Check for month to be
        strictly less than 12, since otherwise we may overrun the array.
 
index b47c59c..ebf191a 100644 (file)
@@ -755,15 +755,15 @@ hildon_time_editor_get_time_separators          (GtkLabel *hm_sep_label,
     g_date_set_dmy (&locale_test_date, 1, 2, 1970);
     (void) g_date_strftime (buffer, sizeof (buffer), "%X", &locale_test_date);
 
+    /* Find h-m separator */
+    iter = buffer;
+    while (*iter && g_ascii_isdigit (*iter)) iter++;
+    /* Extract h-m separator*/
+    endp = iter;
+    while (*endp && ! g_ascii_isdigit (*endp)) endp++;
+
     if (hm_sep_label != NULL)
     {
-        /* Find h-m separator */
-        iter = buffer;
-        while (*iter && g_ascii_isdigit (*iter)) iter++;
-
-        /* Extract h-m separator*/
-        endp = iter;
-        while (*endp && ! g_ascii_isdigit (*endp)) endp++;
         separator = g_strndup (iter, endp - iter);
         gtk_label_set_label (hm_sep_label, separator);
         g_free (separator);