diff --git a/src/trace.c b/src/trace.c index 9357b7f1..a680c9da 100644 --- a/src/trace.c +++ b/src/trace.c @@ -103,7 +103,7 @@ void tf_trace_begin(tf_trace_t* trace, const char* name) return; } - if (!trace->stack || trace->stack->count + 1 < _countof(trace->stack->names)) + if (!trace->stack || trace->stack->count + 1 > _countof(trace->stack->names)) { tf_trace_stack_t* stack = malloc(sizeof(tf_trace_stack_t)); memset(stack, 0, sizeof(*stack)); @@ -111,7 +111,7 @@ void tf_trace_begin(tf_trace_t* trace, const char* name) trace->stack = stack; } tf_trace_stack_t* stack = trace->stack; - while (stack->count == 0 && stack->next && stack->count + 1 < _countof(trace->stack->names)) + while (stack->count == 0 && stack->next && stack->count + 1 > _countof(trace->stack->names)) { stack = stack->next; }