X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=src%2Fprint_cpu_temperature.c;h=569ea6064e4aa234a2e157f68037610ffd01517a;hb=fadd4d89b1e196e009d5cd5cc2f6c3bdda83b12e;hp=feae3ec8a8cb388fc3e8717554d4f851303d65ef;hpb=c64195d14728aa82e280d022e9f7ceff71cfc6c1;p=i3%2Fi3status 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++) = '%'; } }