build: fix build issue with latest gcc

Fix build issues with gcc 9.1 version

Tracked-On: #3121
Signed-off-by: Yin Fengwei <fengwei.yin@intel.com>
This commit is contained in:
Yin Fengwei
2019-05-15 02:46:33 +00:00
committed by wenlingz
parent 57ac00a61f
commit 634e310f9b
13 changed files with 20 additions and 13 deletions

View File

@@ -85,7 +85,8 @@ int main(int argc, char *argv[])
NULL)) != -1) {
switch (op) {
case 'c':
strncpy(cfg, optarg, PATH_MAX);
strncpy(cfg, optarg, PATH_MAX - 1);
cfg[PATH_MAX - 1] = 0;
break;
case 'h':
usage();