js: Fix issue with size truncation and __builtin_strncpy
diff --git a/src/js_funcs.c b/src/js_funcs.c
index eff73f7..532d144 100644
--- a/src/js_funcs.c
+++ b/src/js_funcs.c
@@ -53,7 +53,7 @@
 		return -EIO;
 
 	memset(&ifr, 0, sizeof(ifr));
-	strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name));
+	strncpy(ifr.ifr_name, interface, sizeof(ifr.ifr_name) - 1);
 
 	err = ioctl(sk, SIOCGIFADDR, &ifr);