From df2d9efcf4248444f11b0a62f1fb3b88d6e0f4fa Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Sun, 13 Oct 2024 10:35:48 +0200 Subject: [PATCH] refactor: improve string result return of wrapped `script` proc --- webui.odin | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/webui.odin b/webui.odin index fb15c37..f1790c4 100644 --- a/webui.odin +++ b/webui.odin @@ -211,11 +211,10 @@ script :: proc( cstring(buf), buffer_len, ) - str := fmt.tprintf("%s", buf) if !res { - return str, .Failed + return "", .Failed } - return str, .None + return strings.string_from_ptr(buf, int(buffer_len)), .None } // Parse a JS argument as Odin data type.