1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 12:41:29 +00:00

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));
This commit is contained in:
vincent
2016-07-01 11:27:37 +00:00
parent d0774e7ed5
commit 900f015726

View File

@@ -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);