Skip to content

Commit

Permalink
use allocator.shrink instead of realloc in os.path.real
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Oct 10, 2017
1 parent e6334fe commit 1c28631
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion std/os/path.zig
Expand Up @@ -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);
Expand Down

0 comments on commit 1c28631

Please sign in to comment.