From def772cc0efd7c22c6154c6d9f73df1a08fa2671 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 3 Nov 2021 10:52:38 +0100 Subject: Fix crash when not using text options with text options.before_syntax_highlight is not set to NULL --- tests/main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests') 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 +#include #include #include #include @@ -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); -- cgit v1.2.3