From b184ddedaa0c388e5aa5435c59798766f3392766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Wed, 25 Mar 2020 10:33:47 +0000 Subject: [PATCH] Code cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- src/tun.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tun.c b/src/tun.c index 39303d5..6b9a7de 100644 --- a/src/tun.c +++ b/src/tun.c @@ -131,7 +131,6 @@ tun_create_by_name(char *name, size_t len, const char *dev_name) static int tun_create_by_name(char *name, size_t len, const char *dev_name) { - char tmp[64]; int ret = snprintf(name, len, "%s", dev_name); if (ret <= 0 || (size_t)ret >= len) { @@ -139,6 +138,7 @@ tun_create_by_name(char *name, size_t len, const char *dev_name) return -1; } + char tmp[64]; ret = snprintf(tmp, sizeof(tmp), "/dev/%s", dev_name); if (ret <= 0 || (size_t)ret >= sizeof(tmp)) {