From 1c28631738a7b65e23e5bffc582695faf016045f Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 10 Oct 2017 11:31:53 -0400 Subject: [PATCH] use allocator.shrink instead of realloc in os.path.real --- std/os/path.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/std/os/path.zig b/std/os/path.zig index faf5a5843e..878e4e9e53 100644 --- a/std/os/path.zig +++ b/std/os/path.zig @@ -1006,7 +1006,7 @@ pub fn real(allocator: &Allocator, pathname: []const u8) -> %[]u8 { else => error.Unexpected, }; } - return allocator.realloc(u8, result_buf, cstr.len(result_buf.ptr)); + return allocator.shrink(u8, result_buf, cstr.len(result_buf.ptr)); }, Os.linux => { const fd = %return os.posixOpen(pathname, posix.O_PATH|posix.O_NONBLOCK|posix.O_CLOEXEC, 0, allocator);