Skip to content

Commit f290213

Browse files
committed
fix(examples): use correct Zig function for JS string formatting
- replace deprecated allocPrintZ with allocPrintSentinel in multi-client web app example - ensure proper formatting and memory management for generated JavaScript
1 parent f5a9c13 commit f290213

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

examples/web_app_multi_client/main.zig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,11 @@ fn saveAll(e: *webui.Event) void {
4040
public_input = allocator.dupe(u8, publicInput) catch unreachable;
4141

4242
// general new js
43-
const js = std.fmt.allocPrintZ(
43+
const js = std.fmt.allocPrintSentinel(
4444
allocator,
4545
"document.getElementById(\"publicInput\").value = \"{s}\";",
4646
.{publicInput},
47+
0,
4748
) catch unreachable;
4849
// free js
4950
defer allocator.free(js);

0 commit comments

Comments
 (0)