summaryrefslogtreecommitdiff
path: root/src/glibext/strbuilder.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glibext/strbuilder.c')
-rw-r--r--src/glibext/strbuilder.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/glibext/strbuilder.c b/src/glibext/strbuilder.c
index 54a102b..e48674c 100644
--- a/src/glibext/strbuilder.c
+++ b/src/glibext/strbuilder.c
@@ -2,7 +2,7 @@
/* Chrysalide - Outil d'analyse de fichiers binaires
* strbuilder.c - exportation d'une chaîne de caractères depuis un élément
*
- * Copyright (C) 2024 Cyrille Bagard
+ * Copyright (C) 2025 Cyrille Bagard
*
* This file is part of Chrysalide.
*
@@ -51,6 +51,7 @@ G_DEFINE_INTERFACE(GStringBuilder, g_string_builder, G_TYPE_OBJECT)
static void g_string_builder_default_init(GStringBuilderInterface *iface)
{
+ iface->to_string = NULL;
}
@@ -77,7 +78,11 @@ bool g_string_builder_to_string(const GStringBuilder *builder, unsigned int flag
iface = G_STRING_BUILDER_GET_IFACE(builder);
- result = iface->to_string(builder, flags, out);
+ if (iface->to_string == NULL)
+ result = false;
+
+ else
+ result = iface->to_string(builder, flags, out);
return result;