zig
zig copied to clipboard
Missing null terminator on various kernel32 signatures
Zig Version
0.13.0-dev.75+5c9eb4081
Mismatched signatures
-
GetCurrentDirectoryWhttps://github.com/ziglang/zig/blob/084c2cd90f79d5e7edf76b7ddd390adb95a27f0c/lib/std/os/windows/kernel32.zig#L178lpBuffershould be null-terminated according to https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-getcurrentdirectory -
FormatMessageWhttps://github.com/ziglang/zig/blob/084c2cd90f79d5e7edf76b7ddd390adb95a27f0c/lib/std/os/windows/kernel32.zig#L160lpBuffershould be null-terminated according to https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-formatmessagew -
GetEnvironmentVariableWhttps://github.com/ziglang/zig/blob/084c2cd90f79d5e7edf76b7ddd390adb95a27f0c/lib/std/os/windows/kernel32.zig#L189lpBuffershould be null-terminated according to https://learn.microsoft.com/en-us/windows/win32/api/processenv/nf-processenv-getenvironmentvariablew -
GetModuleFileNameWhttps://github.com/ziglang/zig/blob/084c2cd90f79d5e7edf76b7ddd390adb95a27f0c/lib/std/os/windows/kernel32.zig#L199lpFilenameshould be null-terminated according to https://learn.microsoft.com/en-us/windows/win32/api/libloaderapi/nf-libloaderapi-getmodulefilenamew -
GetFullPathNameWhttps://github.com/ziglang/zig/blob/084c2cd90f79d5e7edf76b7ddd390adb95a27f0c/lib/std/os/windows/kernel32.zig#L220-L225lpBuffershould be null-terminated according to https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-getfullpathnamew
Fixing these would be a breaking change.
Expected Behavior
extern signatures should be correct