Addl fix #323: Rating system
authorColin Clark <colin.clark@cclark.uk>
Tue, 26 Jun 2018 10:59:11 +0000 (11:59 +0100)
committerColin Clark <colin.clark@cclark.uk>
Tue, 26 Jun 2018 10:59:11 +0000 (11:59 +0100)
https://github.com/BestImageViewer/geeqie/issues/323

g_ascii_string_to_unsigned() requires glib 2.54.
The test set-up on Travis requires glib 2.40

src/preferences.c

index 3ea10cf..e319c62 100644 (file)
@@ -1659,13 +1659,13 @@ static guint star_rating_symbol_test(GtkWidget *widget, gpointer data)
        hex_code = g_strsplit(hex_code_full, "+", 2);
        if (hex_code[0] && hex_code[1])
                {
-               g_ascii_string_to_unsigned(hex_code[1], 16, 0, 0x10FFFF, &hex_value, NULL);
+               hex_value = strtoull(hex_code[1], NULL, 16);
                }
-       if (!hex_value)
+       if (!hex_value || hex_value > 0x10FFFF)
                {
                hex_value = 0x003F; // Unicode 'Question Mark'
                }
-       str = g_string_append_unichar(str, hex_value);
+       str = g_string_append_unichar(str, (gunichar)hex_value);
        gtk_label_set_text(g_list_nth_data(list, 1), str->str);
 
        g_strfreev(hex_code);