strings work maybe again?

This commit is contained in:
Kitteh 2021-06-02 17:49:46 +01:00
parent eba788a926
commit b35d589456
2 changed files with 2 additions and 2 deletions

View file

@ -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});

View file

@ -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));
}