Fix error output slightly broken on Windows

Apparently, `perror` on Windows forces a newline before itself, which is
not the behavior intended. Instead, print the error message inline.
This commit is contained in:
ISSOtm
2020-02-11 09:02:59 +01:00
parent c37253fe5a
commit 230f849229

5
src/extern/err.c vendored
View File

@@ -6,9 +6,11 @@
* SPDX-License-Identifier: MIT * SPDX-License-Identifier: MIT
*/ */
#include <errno.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h>
#include "extern/err.h" #include "extern/err.h"
@@ -39,7 +41,8 @@ noreturn_ void rgbds_verr(int status, const char *fmt, va_list ap)
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
fputs(": ", stderr); fputs(": ", stderr);
} }
perror(NULL); fputs(strerror(errno), stderr);
putc('\n', stderr);
exit(status); exit(status);
} }