DEV Community

mnengwa
mnengwa

Posted on

Bun FFi function fails when I return a null terminated slice from ziglang

I'm implementing a ziglang function to generate a ulid. So far it works when called via a main function. However, when using it with Bun's FFI it fails. (console.log) is an empty string.

Zig

const std = @import("std")
pub fn reverse(source: []const u8, target: []u8) void {
    for (source, 0..)

Top comments (0)