Commit 31bf04a6 authored by Michael Natterer's avatar Michael Natterer 😴

libgimpconfig: fix precondition checks in gimp_config_type_register()

check for zero pspecs or more than zero pspecs, but consistently check
both pspecs and n_pspecs.
parent d5231674
Pipeline #116460 passed with stages
in 17 minutes and 24 seconds
......@@ -83,7 +83,8 @@ gimp_config_type_register (GType parent_type,
g_return_val_if_fail (g_type_is_a (parent_type, G_TYPE_OBJECT), G_TYPE_NONE);
g_return_val_if_fail (type_name != NULL, G_TYPE_NONE);
g_return_val_if_fail (pspecs != NULL, G_TYPE_NONE);
g_return_val_if_fail ((pspecs == NULL && n_pspecs == 0) ||
(pspecs != NULL && n_pspecs > 0), G_TYPE_NONE);
terminated_pspecs = g_new0 (GParamSpec *, n_pspecs + 1);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment