diff options
Diffstat (limited to 'src/print_time.c')
-rw-r--r-- | src/print_time.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/print_time.c b/src/print_time.c index 3ed32b0..3a6c4cc 100644 --- a/src/print_time.c +++ b/src/print_time.c @@ -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++) = '%'; } } } |