Skip to content

Commit

Permalink
Adds missing trailing newline to the crash output macro.
Browse files Browse the repository at this point in the history
  • Loading branch information
balazsracz committed Sep 4, 2020
1 parent d350d1b commit c49aba6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ extern const char* g_death_file;
#include <stdio.h>

#ifdef NDEBUG
#define HASSERT(x) do { if (!(x)) { fprintf(stderr, "Assertion failed in file " __FILE__ " line %d: assert(" #x ")", __LINE__); g_death_file = __FILE__; g_death_lineno = __LINE__; abort();} } while(0)
#define HASSERT(x) do { if (!(x)) { fprintf(stderr, "Assertion failed in file " __FILE__ " line %d: assert(" #x ")\n", __LINE__); g_death_file = __FILE__; g_death_lineno = __LINE__; abort();} } while(0)
#else
/// Checks that the value of expression x is true, else terminates the current
/// process.
Expand All @@ -114,7 +114,7 @@ extern const char* g_death_file;

/// Unconditionally terminates the current process with a message.
/// @param MSG is the message to print as cause of death.
#define DIE(MSG) do { fprintf(stderr, "Crashed in file " __FILE__ " line %d: " MSG, __LINE__); g_death_file = __FILE__; g_death_lineno = __LINE__; abort(); } while(0)
#define DIE(MSG) do { fprintf(stderr, "Crashed in file " __FILE__ " line %d: " MSG "\n", __LINE__); g_death_file = __FILE__; g_death_lineno = __LINE__; abort(); } while(0)

#endif

Expand Down

0 comments on commit c49aba6

Please sign in to comment.