diff options
Diffstat (limited to 'src/print_cpu_temperature.c')
-rw-r--r-- | src/print_cpu_temperature.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/print_cpu_temperature.c b/src/print_cpu_temperature.c index feae3ec..569ea60 100644 --- a/src/print_cpu_temperature.c +++ b/src/print_cpu_temperature.c @@ -250,11 +250,13 @@ void print_cpu_temperature_info(yajl_gen json_gen, char *buffer, int zone, const for (walk = selected_format; *walk != '\0'; walk++) { if (*walk != '%') { *(outwalk++) = *walk; - continue; - } - if (BEGINS_WITH(walk + 1, "degrees")) { + + } else if (BEGINS_WITH(walk + 1, "degrees")) { outwalk += sprintf(outwalk, "%s", temperature.formatted_value); walk += strlen("degrees"); + + } else { + *(outwalk++) = '%'; } } |