summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/linux/tunDevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/linux/tunDevice.cpp b/src/linux/tunDevice.cpp
index e3f5bf4..97a7ede 100644
--- a/src/linux/tunDevice.cpp
+++ b/src/linux/tunDevice.cpp
@@ -79,7 +79,7 @@ TunDevice::TunDevice(std::string dev_name, std::string dev_type, std::string ifc
}
if(dev_name != "") {
- strncpy(ifr.ifr_name, dev_name.c_str(), IFNAMSIZ);
+ strncpy(ifr.ifr_name, dev_name.c_str(), IFNAMSIZ-1);
}
fd_ = ::open(DEFAULT_DEVICE, O_RDWR);