Skip to content

Commit df2d9ef

Browse files
committed
refactor: improve string result return of wrapped script proc
1 parent 696a473 commit df2d9ef

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

webui.odin

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,10 @@ script :: proc(
211211
cstring(buf),
212212
buffer_len,
213213
)
214-
str := fmt.tprintf("%s", buf)
215214
if !res {
216-
return str, .Failed
215+
return "", .Failed
217216
}
218-
return str, .None
217+
return strings.string_from_ptr(buf, int(buffer_len)), .None
219218
}
220219

221220
// Parse a JS argument as Odin data type.

0 commit comments

Comments
 (0)