Whoops; make sure we check the return value of read_bool_option.
authorOmari Stephens <xsdg@xsdg.org>
Sun, 31 Jul 2022 21:35:32 +0000 (21:35 +0000)
committerColin Clark <colin.clark@cclark.uk>
Sun, 7 Aug 2022 08:41:53 +0000 (09:41 +0100)
src/rcfile.c

index 66a1597..3d64013 100644 (file)
@@ -545,7 +545,7 @@ static void write_color_profile(GString *outstr, gint indent)
        gint i;
 #ifndef HAVE_LCMS
        g_string_append_printf(outstr, "<!-- NOTICE: %s was not built with support for color profiles,\n"
-                           "         color profile options will have no effect.\n-->\n", GQ_APPNAME);
+                               "                color profile options will have no effect.\n-->\n", GQ_APPNAME);
 #endif
 
        WRITE_NL(); WRITE_STRING("<color_profiles ");
@@ -661,12 +661,12 @@ gboolean save_config_to_file(const gchar *utf8_path, ConfOptions *options, Layou
        outstr = g_string_new("");
        g_string_append_printf(outstr, "<!--\n");
        g_string_append_printf(outstr, "######################################################################\n");
-       g_string_append_printf(outstr, "# %30s config file      version %-10s #\n", GQ_APPNAME, VERSION);
+       g_string_append_printf(outstr, "# %30s config file        version %-10s #\n", GQ_APPNAME, VERSION);
        g_string_append_printf(outstr, "######################################################################\n");
        WRITE_SEPARATOR();
 
        WRITE_STRING("# Note: This file is autogenerated. Options can be changed here,\n");
-       WRITE_STRING("#       but user comments and formatting will be lost.\n");
+       WRITE_STRING("#    but user comments and formatting will be lost.\n");
        WRITE_SEPARATOR();
        WRITE_STRING("-->\n");
        WRITE_SEPARATOR();
@@ -761,12 +761,12 @@ gboolean save_default_layout_options_to_file(const gchar *utf8_path, ConfOptions
        outstr = g_string_new("");
        g_string_append_printf(outstr, "<!--\n");
        g_string_append_printf(outstr, "######################################################################\n");
-       g_string_append_printf(outstr, "# %8s default layout file      version %-10s #\n", GQ_APPNAME, VERSION);
+       g_string_append_printf(outstr, "# %8s default layout file         version %-10s #\n", GQ_APPNAME, VERSION);
        g_string_append_printf(outstr, "######################################################################\n");
        WRITE_SEPARATOR();
 
        WRITE_STRING("# Note: This file is autogenerated. Options can be changed here,\n");
-       WRITE_STRING("#       but user comments and formatting will be lost.\n");
+       WRITE_STRING("#    but user comments and formatting will be lost.\n");
        WRITE_SEPARATOR();
        WRITE_STRING("-->\n");
        WRITE_SEPARATOR();
@@ -1233,8 +1233,12 @@ static void class_filter_load_filter_type(const gchar **attribute_names, const g
                return;
                }
 
-       read_bool_option(enabled_name, "enabled", enabled_value,
-                        &(options->class_filter[load_class_index]);
+       if (!read_bool_option(enabled_name, "enabled", enabled_value,
+                                                 &(options->class_filter[load_class_index])
+               {
+               log_printf("Failed to load <filter_type> config element with "
+                          "class index %d\n", load_class_index);
+               }
 }
 
 static void options_parse_class_filter(GQParserData *parser_data, GMarkupParseContext *UNUSED(context), const gchar *element_name, const gchar **attribute_names, const gchar **attribute_values, gpointer UNUSED(data), GError **UNUSED(error))