From 00fc2f34ee4fd77310e1ed4d1ddacccdb20c473d Mon Sep 17 00:00:00 2001 From: Boian Bonev Date: Mon, 7 Nov 2011 10:22:19 +0530 Subject: fix error handling because get_device_mac return -1 for error, not 0 --- devices.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'devices.c') diff --git a/devices.c b/devices.c index 58c8054..00bf59d 100644 --- a/devices.c +++ b/devices.c @@ -128,7 +128,7 @@ int get_macs(int sockfd, char *name, int name_len, unsigned char *mac) { strncpy(name, int_cursor->ifa_name, name_len - 1); name[name_len - 1] = '\0'; int_cursor = int_cursor->ifa_next; - if (get_device_mac(sockfd, name, mac)) { + if (get_device_mac(sockfd, name, mac)!=-1) { return 1; } } -- cgit v1.2.3