// vim:ts=4:sw=4:expandtab
+#include <config.h>
#include <stdlib.h>
#include <limits.h>
#include <glob.h>
#define ERROR_CODE 1
static int read_temperature(char *thermal_zone, temperature_t *temperature) {
-#if defined(LINUX)
+#if defined(__linux__)
static char buf[16];
long int temp;
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++) = '%';
}
}