linux/tools/power
Anders Roxell 43977b8828 cpupower: remove stringop-truncation waring
commit 8a7e2d2ea0 upstream.

The strncpy doesn't null terminate the string because the size is too
short by one byte.

parse.c: In function ‘prepare_default_config’:
parse.c:148:2: warning: ‘strncpy’ output truncated before terminating
    nul copying 8 bytes from a string of the same length
    [-Wstringop-truncation]
  strncpy(config->governor, "ondemand", 8);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The normal method of passing the length of the destination buffer works
correctly here.

Fixes: 7fe2f6399a ("cpupowerutils - cpufrequtils extended with quite some features")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Shuah Khan (Samsung OSG) <shuah@kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
History 2019-02-11 17:53:16 +00:00
..
acpi Merge branches 'acpi-tools' and 'pm-tools' 2014-06-03 23:13:34 +02:00
cpupower cpupower: remove stringop-truncation waring 2019-02-11 17:53:16 +00:00
x86 tools/power turbostat: Correct SNB_C1/C3_AUTO_UNDEMOTE defines 2018-11-20 18:05:07 +00:00