]> git.sur5r.net Git - i3/i3status/commitdiff
wireless: display no IP instead of (null)
authorMichael Stapelberg <michael@stapelberg.de>
Tue, 26 Jan 2010 13:25:37 +0000 (14:25 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Tue, 26 Jan 2010 13:25:37 +0000 (14:25 +0100)
src/print_wireless_info.c

index b8bdefe91e5f0c5561f0ea8d5f1cb2c4893061ef..946c5898c046cb10ec1b7f68d61b7be6be5a4f7d 100644 (file)
@@ -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");
                 }
         }