From c98f1b5e4a651c17c9c5023a2df287c168b54f3c Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Tue, 14 Nov 2023 14:57:50 -0500 Subject: only print constraint info and errno if present --- src/stdlib/abort_handler_s.c | 8 ++++++-- 1 file 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(); } -- cgit v1.2.1