From 448e40e86c7805d32b345e15d91eb7ab85f3aaf3 Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 17 Oct 2000 18:13:23 +0000 Subject: Update to assert behavior --- libc/misc/assert/__assert.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'libc/misc/assert/__assert.c') diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c index 2ce86c3f1..905671d98 100644 --- a/libc/misc/assert/__assert.c +++ b/libc/misc/assert/__assert.c @@ -15,17 +15,20 @@ const char *str; write(2, str, strlen(str)); } -void __assert(assertion, filename, linenumber) +void __assert(assertion, filename, linenumber, function) const char *assertion; const char *filename; int linenumber; +const char *function; { - errput("Failed assertion '"); - errput(assertion); - errput("' in file "); errput(filename); - errput(" at line "); + errput(":"); errput(itoa(linenumber)); - errput(".\n"); + errput(function ? ": " : ""); + errput(function ? function : ""); + errput(function ? "() " : ""); + errput(": Assertion \""); + errput(assertion); + errput("\" failed.\n"); abort(); } -- cgit v1.2.3