Commit 1c28631738

Andrew Kelley <superjoe30@gmail.com>
2017-10-10 17:31:53
use allocator.shrink instead of realloc in os.path.real
1 parent e6334fe
Changed files (1)
std
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);