summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/stdlib/abort_handler_s.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/stdlib/abort_handler_s.c b/src/stdlib/abort_handler_s.c
index 7639ddfe..c08ebb4e 100644
--- a/src/stdlib/abort_handler_s.c
+++ b/src/stdlib/abort_handler_s.c
@@ -10,8 +10,12 @@ void abort_handler_s(const char * restrict msg, void * restrict ptr, errno_t err
struct __constraint_info *ci = ptr;
puts(msg);
- printf("In call to %s\n", ci->func);
- printf("Provided error: %s (%d)\n", strerror(error), error);
+ if (ci) {
+ printf("In call to %s\n", ci->func);
+ }
+ if (error != 0) {
+ printf("Provided error: %s (%d)\n", strerror(error), error);
+ }
abort();
}