Browse code

core: use memcpy and set end of string

Daniel-Constantin Mierla authored on 08/07/2022 09:14:27
Showing 1 changed files
... ...
@@ -1551,7 +1551,8 @@ static int build_iface_list(void)
1551 1551
 			}
1552 1552
 
1553 1553
 			if(strlen(ifaces[index].name)==0 && strlen(name)>0) {
1554
-				strncpy(ifaces[index].name, name, MAX_IF_LEN-1);
1554
+				memcpy(ifaces[index].name, name, MAX_IF_LEN-1);
1555
+				ifaces[index].name[MAX_IF_LEN-1] = '\0';
1555 1556
 			}
1556 1557
 
1557 1558
 			ifaces[index].index = index;