Another trace fix. Now it's perfect.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3694 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2021-12-21 19:33:02 +00:00
parent d9ffca81f8
commit 7f31798119

View File

@ -152,7 +152,12 @@ void tf_trace_end(tf_trace_t* trace)
{
stack = stack->next;
}
const char* name = stack && stack->count > 0 ? stack->names[stack->count - 1] : NULL;
const char* name = NULL;
if (stack && stack->count > 0)
{
name = stack->names[stack->count - 1];
stack->count--;
}
char line[1024];
int p = snprintf(line, sizeof(line), "{\"ph\": \"E\", \"pid\": %d, \"tid\": 0, \"ts\": %" PRId64 ", \"name\": \"", getpid(), _trace_ts());