]> git.sur5r.net Git - i3/i3status/blobdiff - src/print_path_exists.c
Created three individual Strings for each battery status (charging, dicharching,...
[i3/i3status] / src / print_path_exists.c
index c5225a137405e4c3982666ce11ecd7fe0524a4f1..a2fcb149b041dcb163e1f71761c8e7ea49c3c606 100644 (file)
@@ -21,10 +21,10 @@ void print_path_exists(yajl_gen json_gen, char *buffer, const char *title, const
                         continue;
                 }
 
-                if (strncmp(walk+1, "title", strlen("title")) == 0) {
+                if (BEGINS_WITH(walk+1, "title")) {
                         outwalk += sprintf(outwalk, "%s", title);
                         walk += strlen("title");
-                } else if (strncmp(walk+1, "status", strlen("status")) == 0) {
+                } else if (BEGINS_WITH(walk+1, "status")) {
                         outwalk += sprintf(outwalk, "%s", (exists ? "yes" : "no"));
                         walk += strlen("status");
                 }