From 26247f4f4172a4f79c3d938232bc671d38b9e2b4 Mon Sep 17 00:00:00 2001 From: Zeta <53486764+Apprentice-Alchemist@users.noreply.github.com> Date: Sun, 11 Jun 2023 13:42:40 +0200 Subject: [PATCH] Fix string conversion in hl_window_alert. --- project/src/ExternalInterface.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/project/src/ExternalInterface.cpp b/project/src/ExternalInterface.cpp index 989d1e798..ca2995af7 100644 --- a/project/src/ExternalInterface.cpp +++ b/project/src/ExternalInterface.cpp @@ -3142,7 +3142,9 @@ namespace lime { HL_PRIM void HL_NAME(hl_window_alert) (HL_CFFIPointer* window, hl_vstring* message, hl_vstring* title) { Window* targetWindow = (Window*)window->ptr; - targetWindow->Alert (message ? (const char*)hl_to_utf8 ((const uchar*)message) : NULL, title ? (const char*)hl_to_utf8 ((const uchar*)title) : NULL); + const char *cmessage = message ? hl_to_utf8(message->bytes) : NULL; + const char *ctitle = title ? hl_to_utf8(title->bytes) : NULL; + targetWindow->Alert (cmessage, ctitle); }