Skip to content

Commit 1c28631

Browse files
committed
use allocator.shrink instead of realloc in os.path.real
1 parent e6334fe commit 1c28631

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

std/os/path.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1006,7 +1006,7 @@ pub fn real(allocator: &Allocator, pathname: []const u8) -> %[]u8 {
10061006
else => error.Unexpected,
10071007
};
10081008
}
1009-
return allocator.realloc(u8, result_buf, cstr.len(result_buf.ptr));
1009+
return allocator.shrink(u8, result_buf, cstr.len(result_buf.ptr));
10101010
},
10111011
Os.linux => {
10121012
const fd = %return os.posixOpen(pathname, posix.O_PATH|posix.O_NONBLOCK|posix.O_CLOEXEC, 0, allocator);

0 commit comments

Comments
 (0)