Skip to content

Commit

Permalink
modif: Change errExit msg format to match assert
Browse files Browse the repository at this point in the history
Make it more similar to the assert() message format for consistency.
Example:

Before:

    firejail: main.c:100: main: Assertion `1 == 2' failed.
    Error src/firecfg/main.c:100 main(): malloc: Cannot allocate memory

After:

    firejail: main.c:100: main: Assertion `1 == 2' failed.
    Error src/firecfg/main.c:100: main: malloc: Cannot allocate memory

This amends commit b963fe4 ("Improve errExit error messages",
2023-06-16) / PR netblue30#5871.
  • Loading branch information
kmk3 committed Jan 15, 2024
1 parent 22c728b commit a8abb78
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@

#define errExit(msg) do { \
char msgout[500]; \
snprintf(msgout, 500, "Error %s/%s:%d %s(): %s", \
snprintf(msgout, 500, "Error %s/%s:%d: %s: %s", \
MOD_DIR, __FILE__, __LINE__, __func__, msg); \
perror(msgout); \
exit(1); \
Expand Down

0 comments on commit a8abb78

Please sign in to comment.