From 230f849229f8443703ab281bd1f1cd3ef4eb6d6e Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Tue, 11 Feb 2020 09:02:59 +0100 Subject: [PATCH] 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. --- src/extern/err.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/extern/err.c b/src/extern/err.c index 8731ca4f..c3d4bc33 100644 --- a/src/extern/err.c +++ b/src/extern/err.c @@ -6,9 +6,11 @@ * SPDX-License-Identifier: MIT */ +#include #include #include #include +#include #include "extern/err.h" @@ -39,7 +41,8 @@ noreturn_ void rgbds_verr(int status, const char *fmt, va_list ap) vfprintf(stderr, fmt, ap); fputs(": ", stderr); } - perror(NULL); + fputs(strerror(errno), stderr); + putc('\n', stderr); exit(status); }