From 0687197f08c9e3a17ec86bf751e8d4879151da17 Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Date: Fri, 20 Jan 2023 15:40:29 +0100 Subject: [PATCH] Initialize trace to zero --- src/emu/emu_trace.c | 6 ++++-- src/emu/emu_trace.h | 2 -- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/emu/emu_trace.c b/src/emu/emu_trace.c index 6ab6a39..a96ccdb 100644 --- a/src/emu/emu_trace.c +++ b/src/emu/emu_trace.c @@ -14,7 +14,7 @@ static struct emu_trace *cur_trace = NULL; static void -trace_add(struct emu_trace *trace, struct emu_stream *stream) +add_stream(struct emu_trace *trace, struct emu_stream *stream) { DL_APPEND(trace->streams, stream); trace->nstreams++; @@ -41,7 +41,7 @@ load_stream(struct emu_trace *trace, const char *path) return -1; } - trace_add(trace, stream); + add_stream(trace, stream); return 0; } @@ -84,6 +84,8 @@ cb_nftw(const char *fpath, const struct stat *sb, int emu_trace_load(struct emu_trace *trace, const char *tracedir) { + memset(trace, 0, sizeof(struct emu_trace)); + cur_trace = trace; if (snprintf(trace->tracedir, PATH_MAX, "%s", tracedir) >= PATH_MAX) { diff --git a/src/emu/emu_trace.h b/src/emu/emu_trace.h index e8ff49d..1b0dcd6 100644 --- a/src/emu/emu_trace.h +++ b/src/emu/emu_trace.h @@ -13,8 +13,6 @@ struct emu_trace { long nstreams; struct emu_stream *streams; - - heap_head_t sorted_stream; }; int emu_trace_load(struct emu_trace *trace, const char *tracedir);