diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2021-03-07 17:52:38 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2021-03-07 17:52:38 (GMT) |
commit | 7a60504691ebd8b914592e60990cc3526cf26e29 (patch) | |
tree | 8093ae850e6dc720296c71deee3c3eb0a5763ed1 /plugins/dexbnf | |
parent | a79d209385fca4e74a6a85b2386be71ec23057bb (diff) |
Compact data type definitions.
Diffstat (limited to 'plugins/dexbnf')
-rw-r--r-- | plugins/dexbnf/type.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/dexbnf/type.c b/plugins/dexbnf/type.c index db838c1..b1e4155 100644 --- a/plugins/dexbnf/type.c +++ b/plugins/dexbnf/type.c @@ -66,6 +66,7 @@ static GDataType *dtd_full_class_name(input_buffer *buffer) size_t saved; /* Point de sauvegarde */ char next; /* Prochain caractère obtenu */ GDataType *ns; /* Espace de nom à attribuer */ + bool status; /* Bilan de rattachement */ /** * Les règles traitées sont les suivantes : @@ -116,7 +117,15 @@ static GDataType *dtd_full_class_name(input_buffer *buffer) result = g_class_enum_type_new(CEK_CLASS, name); - g_data_type_set_namespace(result, ns, strdup(".")); + status = g_data_type_set_namespace(result, ns, "."); + + g_object_unref(G_OBJECT(ns)); + + if (!status) + { + g_clear_object(&result); + break; + } } while (1); |