Skip to contentSkip to conversation

demo/posix/cobalt: Avoid ancillaries header

PATCH New Jan Kiszka 1 participant 1 message Sep 28, 2020

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 demo/posix/cobalt: Avoid ancillaries header

From: Jan Kiszka <[email protected]>

Makes the demo more portable.

---
 demo/posix/cobalt/eth_p_all.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
demo/posix/cobalt/eth_p_all.c +1 -2
index 91aef9fbdb..c4cf0d696f 100644
@@ -40,7 +40,6 @@
 #include <net/if.h>
 #include <arpa/inet.h>
 #include <netinet/ether.h>
-#include <boilerplate/ancillaries.h>
 
 char buffer[10*1024];
 int sock;
@@ -73,7 +72,7 @@ int main(int argc, char *argv[])
 	if (argc > 1) {
 		struct ifreq ifr;
 
-		namecpy(ifr.ifr_name, argv[1]);
+		snprintf(ifr.ifr_name, IFNAMSIZ, "%s", argv[1]);
 		if (ioctl(sock, SIOCGIFINDEX, &ifr) < 0) {
 			perror("cannot get interface index");
 			close(sock);
Signature · 1 line
2.26.2