From 97cbed14d00c076372cb3640333c34373028c8d9 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 30 Mar 2020 13:38:00 -0700 Subject: [PATCH] fix -Wformat warning Easier to just use strncpy. --- src/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.c b/src/main.c index 7f2edec..fd1d52f 100644 --- a/src/main.c +++ b/src/main.c @@ -90,7 +90,7 @@ int loadCfg(const char *fpath) } else { - snprintf(cfg.dst_if, IFNAMSIZ, "%s", value); + strncpy(cfg.dst_if, value, IFNAMSIZ); cfg.flags |= PM_DST_IF; } } @@ -104,7 +104,7 @@ int loadCfg(const char *fpath) } else if (strcmp(option, "filter") == 0) { - snprintf(cfg.pfe, PFE_MAX, "%s", value); + strncpy(cfg.pfe, value, PFE_MAX); } else if (strcmp(option, "promiscuous") == 0) {