]> git.sur5r.net Git - i3/i3status/blobdiff - src/print_time.c
able to print percentage
[i3/i3status] / src / print_time.c
index 3ed32b0157ca15810e830c6af38ead375ae73d63..3a6c4cc0752757aa77170500baf4b9e6e1aa2b37 100644 (file)
@@ -57,13 +57,14 @@ void print_time(yajl_gen json_gen, char *buffer, const char *title, const char *
         for (walk = format; *walk != '\0'; walk++) {
             if (*walk != '%') {
                 *(outwalk++) = *walk;
-                continue;
-            }
 
-            if (BEGINS_WITH(walk + 1, "time")) {
+            } else if (BEGINS_WITH(walk + 1, "time")) {
                 strftime(timebuf, sizeof(timebuf), format_time, &tm);
                 maybe_escape_markup(timebuf, &outwalk);
                 walk += strlen("time");
+
+            } else {
+                *(outwalk++) = '%';
             }
         }
     }