allow NULL argument für asc_text()

Thu, 18 Jan 2024 21:58:58 +0100

author
Mike Becker <universe@uap-core.de>
date
Thu, 18 Jan 2024 21:58:58 +0100
changeset 24
7183b4ae9b20
parent 23
ab07757004b4
child 25
601b3f4e17a2

allow NULL argument für asc_text()

src/text.c file | annotate | diff | comparison | revisions
--- a/src/text.c	Thu Jan 18 21:53:16 2024 +0100
+++ b/src/text.c	Thu Jan 18 21:58:58 2024 +0100
@@ -42,7 +42,9 @@
     node->position = (asc_vec2i) {x, y};
     node->font = asc_context.active_font;
     node->color = asc_context.ink;
-    node->text = strdup(text);
+    if (text != NULL) {
+        node->text = strdup(text);
+    }
 
     return node;
 }

mercurial