]> git.sur5r.net Git - i3/i3status/commitdiff
print_ddate(): Correctly seperate the St. Tibs String from the rest
authorAxel Wagner <mail@merovius.de>
Thu, 15 Jul 2010 12:13:25 +0000 (14:13 +0200)
committerMichael Stapelberg <michael@stapelberg.de>
Thu, 15 Jul 2010 13:12:48 +0000 (15:12 +0200)
src/print_ddate.c

index 6f971471ae354b238bc7704f65d295f7fdf61188..16923b2c17e910a20c38b82351caa16fa2583319 100644 (file)
@@ -143,12 +143,12 @@ int format_output(char *format, struct disc_time *dt) {
                                         printf("St. Tib's Day");
                                 } else {
                                         /* ...or parse the substring between %{ and %} ... */
                                         printf("St. Tib's Day");
                                 } else {
                                         /* ...or parse the substring between %{ and %} ... */
-                                        *i = '\0';
+                                        *tibs_end = '\0';
                                         if (!format_output(i + 2, dt)) return 0;
                                         if (!format_output(i + 2, dt)) return 0;
-                                        *i = '%';
+                                        *tibs_end = '%';
                                 }
                                 /* ...and continue with the rest */
                                 }
                                 /* ...and continue with the rest */
-                                i = tibs_end + 2;
+                                i = tibs_end;
                                 break;
                         case '}':
                                 i++;
                                 break;
                         case '}':
                                 i++;