fix incorrect buf len

This commit is contained in:
Andrew Kelley 2018-11-20 12:37:42 -05:00
parent 4dafdc00d5
commit bb3ac177a8
No known key found for this signature in database
GPG Key ID: 4E7CD66038A4D47C

View File

@ -1192,7 +1192,7 @@ pub fn realC(out_buffer: *[os.MAX_PATH_BYTES]u8, pathname: [*]const u8) RealErro
const fd = try os.posixOpenC(pathname, posix.O_PATH | posix.O_NONBLOCK | posix.O_CLOEXEC, 0);
defer os.close(fd);
var buf: ["/dev/fd/-2147483648".len]u8 = undefined;
var buf: ["/dev/fd/-2147483648\x00".len]u8 = undefined;
const proc_path = fmt.bufPrint(buf[0..], "/dev/fd/{}\x00", fd) catch unreachable;
return os.readLinkC(out_buffer, proc_path.ptr);