mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-20 01:02:36 +00:00
tools:acrn-crashlog: fix the compiling error on gcc version 9.0.1
Meet compiling error:
In function ‘strncpy’,
inlined from ‘main’ at main.c:88:4:
/usr/include/bits/string_fortified.h:106:10: error: ‘__builtin_strncpy’
specified bound 4096 equals destination size
[-Werror=stringop-truncation]
106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos
(__dest));
|
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
This patch aims to fix it.
Tracked-On: #1024
Signed-off-by: Liu, Xinwu <xinwu.liu@intel.com>
Acked-by: Chen, Gang <gang.c.chen@intel.com>
This commit is contained in:
parent
b22a510d8d
commit
f8b1c504f0
@ -85,7 +85,7 @@ int main(int argc, char *argv[])
|
|||||||
NULL)) != -1) {
|
NULL)) != -1) {
|
||||||
switch (op) {
|
switch (op) {
|
||||||
case 'c':
|
case 'c':
|
||||||
strncpy(cfg, optarg, PATH_MAX);
|
strncpy(cfg, optarg, PATH_MAX - 1);
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 'h':
|
||||||
usage();
|
usage();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user