INSTANCE(interface);
+ const char *ip_address = get_ip_addr(interface);
+ if (ip_address == NULL) {
+ START_COLOR("color_bad");
+ outwalk += sprintf(outwalk, "%s", format_down);
+ goto out;
+ } else {
+ START_COLOR("color_good");
+ }
+
if (get_wireless_info(interface, &info)) {
walk = format_up;
if (info.flags & WIRELESS_INFO_FLAG_HAS_QUALITY)
}
if (BEGINS_WITH(walk+1, "ip")) {
- const char *ip_address = get_ip_addr(interface);
- outwalk += sprintf(outwalk, "%s", (ip_address ? ip_address : "no IP"));
- walk += strlen("ip");
+ outwalk += sprintf(outwalk, "%s", ip_address);
+ walk += strlen("ip");
}
#ifdef LINUX
#endif
}
+out:
END_COLOR;
OUTPUT_FULL_TEXT(buffer);
}