diff --git a/src/gwidth.zig b/src/gwidth.zig index abf560a..f41f37d 100644 --- a/src/gwidth.zig +++ b/src/gwidth.zig @@ -31,7 +31,8 @@ pub fn gwidth(str: []const u8, method: Method) !usize { .no_zwj => { var out: [256]u8 = undefined; if (str.len > out.len) return error.OutOfMemory; - const n = std.mem.replace(u8, str, "\u{200D}", "", &out); + const n = std.mem.replacementSize(u8, str, "\u{200D}", ""); + _ = std.mem.replace(u8, str, "\u{200D}", "", &out); return gwidth(out[0..n], .unicode); }, }