Fixed the .len
This commit is contained in:
parent
8d0f73e951
commit
6461e6719c
1 changed files with 1 additions and 1 deletions
|
@ -30,7 +30,7 @@ pub fn gwidth(str: []const u8, method: Method) !usize {
|
||||||
},
|
},
|
||||||
.no_zwj => {
|
.no_zwj => {
|
||||||
var out: [256]u8 = undefined;
|
var out: [256]u8 = undefined;
|
||||||
if (str.len > out) return error.OutOfMemory;
|
if (str.len > out.len) return error.OutOfMemory;
|
||||||
const n = std.mem.replace(u8, str, "\u{200D}", "", &out);
|
const n = std.mem.replace(u8, str, "\u{200D}", "", &out);
|
||||||
return gwidth(out[0..n], .unicode);
|
return gwidth(out[0..n], .unicode);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue