Commit e13da9a1 authored by Colin Ian King's avatar Colin Ian King Committed by Len Brown

tools/power turbostat: replace strncmp with single character compare

Using strncmp for a single character comparison is overly complicated,
just use a simpler single character comparison instead. Also stops
static analyzers (such as cppcheck) from complaining about strncmp on
non-null terminated strings.
Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent 03331233
...@@ -2976,7 +2976,7 @@ int get_thread_siblings(struct cpu_topology *thiscpu) ...@@ -2976,7 +2976,7 @@ int get_thread_siblings(struct cpu_topology *thiscpu)
} }
} }
} }
} while (!strncmp(&character, ",", 1)); } while (character == ',');
fclose(filep); fclose(filep);
return CPU_COUNT_S(size, thiscpu->put_ids); return CPU_COUNT_S(size, thiscpu->put_ids);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment