mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-24 03:52: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
|
* 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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user