diff options
author | Eric Andersen <andersen@codepoet.org> | 2000-10-17 18:13:23 +0000 |
---|---|---|
committer | Eric Andersen <andersen@codepoet.org> | 2000-10-17 18:13:23 +0000 |
commit | 448e40e86c7805d32b345e15d91eb7ab85f3aaf3 (patch) | |
tree | 81a947202c41706166b0cfc8077a68e8f5804500 /libc/misc/assert | |
parent | 3c5b48ca8375629db5638e9275d7de17ed778169 (diff) |
Update to assert behavior
Diffstat (limited to 'libc/misc/assert')
-rw-r--r-- | libc/misc/assert/__assert.c | 15 |
1 files changed, 9 insertions, 6 deletions
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(); } |