diff --git a/src/qtshit/read.zig b/src/qtshit/read.zig index fa681e3..152f189 100644 --- a/src/qtshit/read.zig +++ b/src/qtshit/read.zig @@ -37,7 +37,7 @@ pub fn get_string(reader: anytype, allocator: *std.mem.Allocator) ![]u8 { defer data.deinit(); var length = try reader.readIntBig(i32); - var chars = @divTrunc(@divTrunc(length, 8), 2); + var chars = @divTrunc(length, 2); // std.debug.print("get_lenchars: {d} {d} \n", .{length, chars}); diff --git a/src/qtshit/write.zig b/src/qtshit/write.zig index f5167a0..1119908 100644 --- a/src/qtshit/write.zig +++ b/src/qtshit/write.zig @@ -26,7 +26,7 @@ pub fn add_string(writer: anytype, allocator: *std.mem.Allocator, str: []const u } // std.debug.print("add_lenchars: {d} {d} \n", .{@intCast(i32, ut16Str.len*8*2), str.len}); - try writer.writeIntBig(i32, @intCast(i32, ut16Str.len*8*2)); + try writer.writeIntBig(i32, @intCast(i32, ut16Str.len*2)); try writer.writeAll(std.mem.sliceAsBytes(ut16Str)); }