freebsd: fix os_self_exe_path function and update std lib

This commit is contained in:
Andrew Kelley
2018-12-12 22:28:15 -05:00
parent b883bc873d
commit d770333827
2 changed files with 5 additions and 4 deletions

View File

@@ -1456,7 +1456,7 @@ Error os_self_exe_path(Buf *out_path) {
if (sysctl(mib, 4, buf_ptr(out_path), &cb, nullptr, 0) != 0) {
return ErrorUnexpected;
}
buf_resize(out_path, cb);
buf_resize(out_path, cb - 1);
return ErrorNone;
#endif
return ErrorFileNotFound;