use allocator.shrink instead of realloc in os.path.real

This commit is contained in:
Andrew Kelley 2017-10-10 11:31:53 -04:00
parent e6334fe46d
commit 1c28631738

View File

@ -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);