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/prox_lua.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'VNFs/DPPD-PROX/prox_lua.c') diff --git a/VNFs/DPPD-PROX/prox_lua.c b/VNFs/DPPD-PROX/prox_lua.c index b5c2fec9..4e2f18a6 100644 --- a/VNFs/DPPD-PROX/prox_lua.c +++ b/VNFs/DPPD-PROX/prox_lua.c @@ -20,6 +20,7 @@ #include "prox_lua.h" #include "lua_compat.h" #include "parse_utils.h" +#include "prox_compat.h" static struct lua_State *lua_instance; @@ -137,7 +138,7 @@ static int l_mac(lua_State *L) if (lua_isstring(L, -1)) { const char *arg = lua_tostring(L, -1); char arg2[128]; - strncpy(arg2, arg, sizeof(arg2)); + prox_strncpy(arg2, arg, sizeof(arg2)); char *p = arg2; int count = 0; @@ -223,7 +224,7 @@ static int l_ip6(lua_State *L) int next_str = 1; int ret; - strncpy(arg2, arg, sizeof(arg2)); + prox_strncpy(arg2, arg, sizeof(arg2)); for (size_t i = 0; i < str_len; ++i) { if (next_str) { @@ -270,7 +271,7 @@ static int l_cidr(lua_State *L) const char *arg = lua_tostring(L, -1); char tmp[128]; - strncpy(tmp, arg, sizeof(tmp)); + prox_strncpy(tmp, arg, sizeof(tmp)); char *slash = strchr(tmp, '/'); *slash = 0; @@ -296,7 +297,7 @@ static int l_cidr6(lua_State *L) const char *arg = lua_tostring(L, -1); char tmp[128]; - strncpy(tmp, arg, sizeof(tmp)); + prox_strncpy(tmp, arg, sizeof(tmp)); char *slash = strchr(tmp, '/'); *slash = 0; -- cgit 1.2.3-korg