Make the output from assert() look more like the example in the C99
standard. Requested by: bde
This commit is contained in:
parent
73a8314696
commit
a535f37a5c
@ -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