aboutsummaryrefslogtreecommitdiff
path: root/modules/benchmark
diff options
context:
space:
mode:
authorbigbear <ns@bigbear.dk>2024-02-08 04:38:31 +0100
committerbigbear <ns@bigbear.dk>2024-02-08 20:25:46 +0100
commitd61f38badd7a3f5f4ca7a0d17aa81e081d81dd49 (patch)
tree8d9dbdb15bb25cf396e9d4ffd492308e0966ba39 /modules/benchmark
parentddf42c8dfd3523952d3debe335fc6efff8c107ba (diff)
FIX QLcode - sscanf incorrect check
Diffstat (limited to 'modules/benchmark')
-rw-r--r--modules/benchmark/bench_results.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/modules/benchmark/bench_results.c b/modules/benchmark/bench_results.c
index 42930d74..18ed0739 100644
--- a/modules/benchmark/bench_results.c
+++ b/modules/benchmark/bench_results.c
@@ -71,7 +71,7 @@ static char *cpu_config_retranslate(char *str, int force_en, int replacing)
if (str != NULL) {
new_str = strdup("");
if (strchr(str, 'x')) {
- while (c != NULL && sscanf(c, "%dx %f", &t, &f)) {
+ while (c != NULL && (sscanf(c, "%dx %f", &t, &f)==2)) {
tmp = g_strdup_printf("%s%s%dx %.2f %s", new_str,
strlen(new_str) ? " + " : "", t, f, mhz);
free(new_str);
@@ -103,7 +103,7 @@ static float cpu_config_val(char *str)
float f, r = 0.0;
if (str != NULL) {
if (strchr(str, 'x')) {
- while (c != NULL && sscanf(c, "%dx %f", &t, &f)) {
+ while (c != NULL && (sscanf(c, "%dx %f", &t, &f)==2)) {
r += f * t;
c = strchr(c + 1, '+');
if (c)