mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-18 17:54:13 +08:00
8a7e2d2ea0
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:
|
||
---|---|---|
.. | ||
benchmark.c | ||
benchmark.h | ||
config.h | ||
cpufreq-bench_plot.sh | ||
cpufreq-bench_script.sh | ||
example.cfg | ||
main.c | ||
Makefile | ||
parse.c | ||
parse.h | ||
README-BENCH | ||
system.c | ||
system.h |