aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2021-11-03 10:52:38 +0100
committerdec05eba <dec05eba@protonmail.com>2021-11-03 10:52:38 +0100
commitdef772cc0efd7c22c6154c6d9f73df1a08fa2671 (patch)
treecf888ca1ca97f109b474eec209f2be7af406f68b /tests
parent111f0ba3f4a4f14d39c8e3f7c00f13e852f47a51 (diff)
Fix crash when not using text options with text
options.before_syntax_highlight is not set to NULL
Diffstat (limited to 'tests')
-rw-r--r--tests/main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/main.c b/tests/main.c
index 4f29a55..6a69866 100644
--- a/tests/main.c
+++ b/tests/main.c
@@ -1,4 +1,5 @@
#include <stdio.h>
+#include <string.h>
#include <mgl/mgl.h>
#include <mgl/window/window.h>
#include <mgl/window/event.h>
@@ -44,7 +45,7 @@ static void draw(mgl_window *window, void *userdata) {
snprintf(str, sizeof(str), "Hello world!\nelapsed time: %f", mgl_clock_get_elapsed_time_seconds(&u->clock));
mgl_text text;
- mgl_text_init(&text, u->font, str, 0.0f, 0.0f);
+ mgl_text_init(&text, u->font, str, strlen(str), NULL);
mgl_text_draw(context, &text);
mgl_text_deinit(&text);