diff options
| author | Burt P <pburt0@gmail.com> | 2019-08-08 13:47:22 -0500 | 
|---|---|---|
| committer | Leandro A. F. Pereira <leandro@hardinfo.org> | 2019-08-10 16:46:57 -0700 | 
| commit | 21eb4146b77c48ec9b399c201f290b1417878676 (patch) | |
| tree | f94c0e10337bb192ca3dd9fba4107f093729d71a /modules | |
| parent | 9c478d2a23fac7a2b0d7aa41981571d27631134e (diff) | |
benchmark: make sure lookup key is unique
Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/benchmark.c | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/modules/benchmark.c b/modules/benchmark.c index 60b3e9f4..dc71be90 100644 --- a/modules/benchmark.c +++ b/modules/benchmark.c @@ -322,10 +322,11 @@ gchar *hi_get_field(gchar * field)  }  static void br_mi_add(char **results_list, bench_result *b, gboolean select) { +    static unsigned int ri = 0; /* to ensure key is unique */      gchar *ckey, *rkey;      ckey = hardinfo_clean_label(b->machine->cpu_name, 0); -    rkey = strdup(b->machine->mid); +    rkey = g_strdup_printf("%s__%d", b->machine->mid, ri++);      *results_list = h_strdup_cprintf("$%s%s$%s=%.2f|%s\n", *results_list,          select ? "*" : "", rkey, ckey, | 
