i3 - improved tiling WM


Pad wifi bitrate.

Patch status: needinfo

Patch by Kevin Pulo

To apply this patch, use:
curl http://cr.i3wm.org/patch/415/raw.patch | git am

b/src/print_wireless_info.c

13
@@ -406,7 +406,13 @@ void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface,
14
 
15
                         iw_print_bitrate(br_buffer, sizeof(br_buffer), info.bitrate);
16
 
17
-                        outwalk += sprintf(outwalk, "%s", br_buffer);
18
+                        if (strlen(br_buffer) >= 3 &&
19
+                                br_buffer[0] >= '0' && br_buffer[0] <= '9' &&
20
+                                br_buffer[1] >= '0' && br_buffer[1] <= '9' &&
21
+                                br_buffer[2] == ' ')
22
+                            outwalk += sprintf(outwalk, "0%s", br_buffer);
23
+                        else
24
+                            outwalk += sprintf(outwalk, "%s", br_buffer);
25
                         walk += strlen("bitrate");
26
                 }
27
 #endif