diff options
author | Jakob Kaivo <jkk@ung.org> | 2023-11-14 14:57:50 -0500 |
---|---|---|
committer | Jakob Kaivo <jkk@ung.org> | 2023-11-14 14:57:50 -0500 |
commit | c98f1b5e4a651c17c9c5023a2df287c168b54f3c (patch) | |
tree | 4d9a9489afe3803f8471a233e5ac3dfe97cc243d | |
parent | 5157755a3acb693e9e213ecf065f7162257afbea (diff) |
only print constraint info and errno if present
-rw-r--r-- | src/stdlib/abort_handler_s.c | 8 |
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(); } |