summaryrefslogtreecommitdiff
path: root/src/linux/tun.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/linux/tun.c')
-rw-r--r--src/linux/tun.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/linux/tun.c b/src/linux/tun.c
index c77cea1..fccea9c 100644
--- a/src/linux/tun.c
+++ b/src/linux/tun.c
@@ -103,7 +103,7 @@ int tun_init(tun_device_t* dev, const char* dev_name, const char* dev_type, cons
}
if(dev_name)
- strncpy(ifr.ifr_name, dev_name, IFNAMSIZ);
+ strncpy(ifr.ifr_name, dev_name, IFNAMSIZ-1);
if(!ioctl(dev->fd_, TUNSETIFF, &ifr)) {
dev->actual_name_ = strdup(ifr.ifr_name);