mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-23 19:42:08 +00:00
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:
5
src/extern/err.c
vendored
5
src/extern/err.c
vendored
@@ -6,9 +6,11 @@
|
||||
* SPDX-License-Identifier: MIT
|
||||
*/
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.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);
|
||||
fputs(": ", stderr);
|
||||
}
|
||||
perror(NULL);
|
||||
fputs(strerror(errno), stderr);
|
||||
putc('\n', stderr);
|
||||
exit(status);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user