From fb0c44a8e62de7cf06a1ad0c025ac7ecb39cad27 Mon Sep 17 00:00:00 2001 From: Xavier Simonart Date: Tue, 13 Aug 2019 10:14:32 -0400 Subject: Support for recent GCC compiler This is required for instance on gcc (GCC) 8.2.1 20180905 Signed-off-by: Xavier Simonart Change-Id: Id86de5d39d77c5cbf168cc51434f436f84376a4c --- VNFs/DPPD-PROX/cmd_parser.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'VNFs/DPPD-PROX/cmd_parser.c') diff --git a/VNFs/DPPD-PROX/cmd_parser.c b/VNFs/DPPD-PROX/cmd_parser.c index ced6d288..79c939b9 100644 --- a/VNFs/DPPD-PROX/cmd_parser.c +++ b/VNFs/DPPD-PROX/cmd_parser.c @@ -52,6 +52,7 @@ #include "handle_cgnat.h" #include "handle_impair.h" #include "rx_pkt.h" +#include "prox_compat.h" static int core_task_is_valid(int lcore_id, int task_id) { @@ -823,7 +824,7 @@ static int parse_cmd_rule_add(const char *str, struct input *input) return -1; char *fields[9]; char str_cpy[255]; - strncpy(str_cpy, str, 255); + prox_strncpy(str_cpy, str, 255); // example add rule command: rule add 15 0 1&0x0fff 1&0x0fff 0&0 128.0.0.0/1 128.0.0.0/1 5000-5000 5000-5000 allow int ret = rte_strsplit(str_cpy, 255, fields, 9, ' '); if (ret != 8) { @@ -1491,7 +1492,7 @@ static int parse_cmd_stats(const char *str, struct input *input) char *ret = ret2; int list = 0; - strncpy(buf, str, sizeof(buf) - 1); + prox_strncpy(buf, str, sizeof(buf) - 1); char *tok; uint64_t stat_val; @@ -2157,7 +2158,7 @@ static int parse_cmd_help(const char *str, struct input *input) if (strlen(cmd_strings[i].args)) { char tmp[256] = {0}; - strncpy(tmp, cmd_strings[i].args, 128); + prox_strncpy(tmp, cmd_strings[i].args, 128); snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "Arguments: %s\n", tmp); len2 = len; if (strlen(cmd_strings[i].help)) { @@ -2189,7 +2190,7 @@ static int parse_cmd_help(const char *str, struct input *input) len3 = max_len; } - strncpy(tmp, h, len3); + prox_strncpy(tmp, h, len3); h += len3; while (h[0] == ' ' && strlen(h)) h++; -- cgit 1.2.3-korg