0
0
mirror of https://github.com/openwrt/packages.git synced 2025-02-12 02:21:14 +00:00
packages/net/port-mirroring/patches/010-snprintf-to-strncpy.patch
Rosen Penev 4108353ec1 port-mirroring: Fix compilation with GCC8
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2019-05-16 13:32:54 -07:00

21 lines
678 B
Diff

--- 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)
{