Skip to content

Commit

Permalink
refactor: improve string result return of wrapped script proc
Browse files Browse the repository at this point in the history
  • Loading branch information
ttytm committed Oct 13, 2024
1 parent 696a473 commit df2d9ef
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions webui.odin
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit df2d9ef

Please sign in to comment.