summaryrefslogtreecommitdiff
path: root/os/xprintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/xprintf.c')
-rw-r--r--os/xprintf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/os/xprintf.c b/os/xprintf.c
index 254b7374a..3b4bb4117 100644
--- a/os/xprintf.c
+++ b/os/xprintf.c
@@ -64,6 +64,8 @@
#include "os.h"
#include <stdarg.h>
#include <stdio.h>
+#include <errno.h>
+#include <string.h>
#ifdef asprintf
# undef asprintf
@@ -154,8 +156,7 @@ XNFvasprintf(char **ret, const char * _X_RESTRICT_KYWD format, va_list va)
{
int size = vasprintf(ret, format, va);
if ((size == -1) || (*ret == NULL)) {
- Error("XNFvasprintf");
- FatalError("XNFvasprintf failed");
+ FatalError("XNFvasprintf failed: %s", strerror(errno));
}
return size;
}