sbm

simple bandwidth monitor
git clone git://git.2f30.org/sbm
Log | Files | Refs | LICENSE

commit ab192648f67b9c8567437ab6c5b4a263cff175c3
parent edc9b345af36f754890717f1707806cdfdc124a4
Author: Quentin Rameau <quinq@fifth.space>
Date:   Tue, 16 Feb 2016 17:37:33 +0100

Replace IFNAMSIZ with IF_NAMESIZE

Diffstat:
Msbm.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/sbm.c b/sbm.c @@ -45,7 +45,7 @@ scan(char *ifname) err(1, "getifaddrs"); if (*ifname) { for (ifa = ifas; ifa; ifa = ifa->ifa_next) { - if (!strncmp(ifname, ifa->ifa_name, IFNAMSIZ)) { + if (!strncmp(ifname, ifa->ifa_name, IF_NAMESIZE)) { found = 1; break; } @@ -56,8 +56,8 @@ scan(char *ifname) continue; if (ifa->ifa_flags & IFF_RUNNING) { if (ifa->ifa_flags & IFF_UP) { - strncpy(ifname, ifa->ifa_name, IFNAMSIZ); - ifname[IFNAMSIZ - 1] = '\0'; + strncpy(ifname, ifa->ifa_name, IF_NAMESIZE); + ifname[IF_NAMESIZE - 1] = '\0'; found = 1; break; } @@ -206,12 +206,12 @@ usage(void) int main(int argc, char *argv[]) { - char ifname[IFNAMSIZ] = ""; + char ifname[IF_NAMESIZE] = ""; ARGBEGIN { case 'i': strncpy(ifname, EARGF(usage()), sizeof(ifname)); - ifname[IFNAMSIZ - 1] = '\0'; + ifname[IF_NAMESIZE - 1] = '\0'; break; default: usage();