strings work maybe again?
This commit is contained in:
parent
eba788a926
commit
b35d589456
|
@ -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});
|
||||
|
||||
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue