minieap
minieap copied to clipboard
小修小补
- 把上一次 PR(https://github.com/updateing/minieap/pull/80)里的“将最后一字节置零来保证 null-terminated”替换为了
strndup自动置零 -
IFNAMSIZ是包含空终止字符的缓冲区大小,因此需要限制用户输入的网络界面名字符串长度为IFNAMSIZ - 1
The <net/if.h> header shall define the following symbolic constant for the length of a buffer containing an interface name (including the terminating NULL character): IF_NAMESIZE Interface name length.