Don't show (win32 error 0)

This commit is contained in:
Justine Tunney 2023-11-28 21:30:20 -08:00
parent 9cad66aa11
commit ca5e361919
No known key found for this signature in database
GPG key ID: BE714B4575D6E328

View file

@ -53,7 +53,7 @@ errno_t strerror_r(int err, char *buf, size_t size) {
// copy windows error information // copy windows error information
if (IsWindows()) { if (IsWindows()) {
uint32_t winerr; uint32_t winerr;
if ((winerr = GetLastError()) != err) { if ((winerr = GetLastError()) != err && winerr) {
stpcpy(FormatUint32(stpcpy(tmp, " (win32 error "), winerr), ")"); stpcpy(FormatUint32(stpcpy(tmp, " (win32 error "), winerr), ")");
msg = tmp; msg = tmp;
while ((c = *msg++) && p + 1 < pe) { while ((c = *msg++) && p + 1 < pe) {