From 900f015726243217c336a20b6cca37be5bcb23cc Mon Sep 17 00:00:00 2001 From: vincent Date: Fri, 1 Jul 2016 11:27:37 +0000 Subject: [PATCH] Silencing sizeof() warning Here, the sizeof() function return the size of 'char *' instead of INTF_NAME_LEN. I replaced the use of the latter function by INTF_NAME_LEN (maximum size of the array intf_name). Here is the compiler warning output: route-bsd.c:171:38: warning: sizeof on array function parameter will return size of 'char *' instead of 'char [16]' [-Wsizeof-array-argument] strlcpy(intf_name, namebuf, sizeof(intf_name)); --- libdnet-stripped/src/route-bsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdnet-stripped/src/route-bsd.c b/libdnet-stripped/src/route-bsd.c index 7aa2eaf3e..9702422a3 100644 --- a/libdnet-stripped/src/route-bsd.c +++ b/libdnet-stripped/src/route-bsd.c @@ -168,7 +168,7 @@ route_msg(route_t *r, int type, char intf_name[INTF_NAME_LEN], struct addr *dst, errno = ESRCH; return (-1); } - strlcpy(intf_name, namebuf, sizeof(intf_name)); + strlcpy(intf_name, namebuf, INTF_NAME_LEN); } } return (0);