summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2010-01-26 14:25:37 +0100
committerMichael Stapelberg <michael@stapelberg.de>2010-01-26 14:25:37 +0100
commit9c14b7a527a34f0ed04a53c72fe85f4d21f094ec (patch)
treed804a0134517ef3eff053883b1eac81396064bbd
parentc166d2e2d312e198a4dc9039302c5b82ed2805d1 (diff)
wireless: display no IP instead of (null)
-rw-r--r--src/print_wireless_info.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c
index b8bdefe..946c589 100644
--- a/src/print_wireless_info.c
+++ b/src/print_wireless_info.c
@@ -86,7 +86,10 @@ void print_wireless_info(const char *interface, const char *format_up, const cha
}
if (BEGINS_WITH(walk+1, "ip")) {
- (void)printf("%s", get_ip_addr(interface));
+ const char *ip_address = get_ip_addr(interface);
+ if (ip_address != NULL)
+ (void)printf("%s", get_ip_addr(interface));
+ else (void)printf("no IP");
walk += strlen("ip");
}
}