summaryrefslogtreecommitdiff
path: root/lily-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'lily-test.c')
-rw-r--r--lily-test.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/lily-test.c b/lily-test.c
index 7484894..17959ca 100644
--- a/lily-test.c
+++ b/lily-test.c
@@ -30,7 +30,8 @@ static void _lily_assert_msg(bool statement, const char *location,
size_t length = vsnprintf(NULL, 0, format_string, args_len);
va_end(args_len);
- if (_lily_globals.error_msg_len < length+1) {
+ if (_lily_globals.error_msg_len < length+1 ||
+ _lily_globals.error_msg == NULL) {
if (_lily_globals.error_msg != NULL)
free(_lily_globals.error_msg);
@@ -46,12 +47,9 @@ static void _lily_assert_msg(bool statement, const char *location,
else {
_lily_globals.error_msg = msg;
_lily_globals.error_msg_len = length+1;
- printf("reallocated global msg: %p ", msg);
}
}
- printf("length: %lu ", length);
-
vsnprintf(_lily_globals.error_msg, length+1, format_string, args);
va_end(args);