aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--deps/sysobj_early/src/util_sysobj.c2
-rw-r--r--modules/benchmark/bench_results.c4
-rw-r--r--modules/devices/x86/processor.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/deps/sysobj_early/src/util_sysobj.c b/deps/sysobj_early/src/util_sysobj.c
index de3ec8b2..94f71944 100644
--- a/deps/sysobj_early/src/util_sysobj.c
+++ b/deps/sysobj_early/src/util_sysobj.c
@@ -100,7 +100,7 @@ int util_get_did(gchar *str, const gchar *lbl) {
gchar tmpfmt[128] = "";
gchar tmpchk[128] = "";
sprintf(tmpfmt, "%s%s", lbl, "%d");
- if ( sscanf(str, tmpfmt, &id) ) {
+ if ( sscanf(str, tmpfmt, &id)==1 ) {
sprintf(tmpchk, tmpfmt, id);
if ( SEQ(str, tmpchk) )
return id;
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)
diff --git a/modules/devices/x86/processor.c b/modules/devices/x86/processor.c
index 518786b5..4141f051 100644
--- a/modules/devices/x86/processor.c
+++ b/modules/devices/x86/processor.c
@@ -588,7 +588,7 @@ gchar *processor_get_capabilities_from_flags(gchar *strflags, gchar *lookup_pref
old = flags;
while (flags[j]) {
- if ( sscanf(flags[j], "[%d]", &i) ) {
+ if ( sscanf(flags[j], "[%d]", &i)==1 ) {
/* Some flags are indexes, like [13], and that looks like
* a new section to hardinfo shell */
tmp = h_strdup_cprintf("(%s%d)=\n", tmp,