From 5f7b6b015facd6da75b7db612e6e21945a3f9faa Mon Sep 17 00:00:00 2001 From: Kitteh Date: Tue, 1 Jun 2021 13:06:12 +0100 Subject: [PATCH] Make tests work again, --- src/qtshit/read.zig | 2 -- src/qtshit/test.zig | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/qtshit/read.zig b/src/qtshit/read.zig index 48a9389..a55e867 100644 --- a/src/qtshit/read.zig +++ b/src/qtshit/read.zig @@ -14,8 +14,6 @@ pub fn get_byte(reader: anytype) !u8 { } pub fn get_string(reader: anytype, allocator: *std.mem.Allocator) ![]u8 { - var buffer: [1024]u8 = undefined; - return try reader.readUntilDelimiterAlloc( allocator, '\x00', diff --git a/src/qtshit/test.zig b/src/qtshit/test.zig index 37107ac..6f66c4a 100644 --- a/src/qtshit/test.zig +++ b/src/qtshit/test.zig @@ -70,6 +70,12 @@ test "read/write stringlist" { var fBS = std.io.fixedBufferStream(byteList.items); var val = try read.get_stringlist(fBS.reader(), global_allocator); + defer { + for (val.items) |str| { + global_allocator.free(str); + } + val.deinit(); + } try expect(arr.items.len == val.items.len); for (arr.items) |str, index| {