mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-11-27 09:12:44 +00:00
Make the output from assert() look more like the example in the C99
standard. Requested by: bde
This commit is contained in:
parent
b5f7b8be86
commit
762e881bab
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=85671
@ -52,11 +52,11 @@ __assert(func, file, line, failedexpr)
|
||||
{
|
||||
if (func == NULL)
|
||||
(void)fprintf(stderr,
|
||||
"assertion (%s) failed: file %s:%d\n", failedexpr,
|
||||
"Assertion failed: (%s), file %s, line %d.\n", failedexpr,
|
||||
file, line);
|
||||
else
|
||||
(void)fprintf(stderr,
|
||||
"assertion (%s) failed: function %s(), file %s:%d\n",
|
||||
"Assertion failed: (%s), function %s, file %s, line %d.\n",
|
||||
failedexpr, func, file, line);
|
||||
abort();
|
||||
/* NOTREACHED */
|
||||
|
@ -35,10 +35,10 @@ void
|
||||
__assert(const char *func, const char *file, int line, const char *expression)
|
||||
{
|
||||
if (func == NULL)
|
||||
printf("assertion (%s) failed: file %s:%d\n", expression,
|
||||
file, line);
|
||||
printf("Assertion failed: (%s), file %s, line %d.\n",
|
||||
expression, file, line);
|
||||
else
|
||||
printf("assertion (%s) failed: function %s(), file %s:%d\n",
|
||||
expression, func, file, line);
|
||||
printf("Assertion failed: (%s), function %s, file %s, line "
|
||||
"%d.\n", expression, func, file, line);
|
||||
exit();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user