Skip to content

Commit

Permalink
Don't show (win32 error 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
jart committed Nov 29, 2023
1 parent 9cad66a commit ca5e361
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libc/intrin/strerror_r.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ errno_t strerror_r(int err, char *buf, size_t size) {
// copy windows error information
if (IsWindows()) {
uint32_t winerr;
if ((winerr = GetLastError()) != err) {
if ((winerr = GetLastError()) != err && winerr) {
stpcpy(FormatUint32(stpcpy(tmp, " (win32 error "), winerr), ")");
msg = tmp;
while ((c = *msg++) && p + 1 < pe) {
Expand Down

0 comments on commit ca5e361

Please sign in to comment.