diff --git a/main.c b/main.c index 1730bc6..5765a5c 100644 --- a/main.c +++ b/main.c @@ -198,9 +198,9 @@ int main (int argc, char **arv) { fscanf(serial, "%s%d", string, &val); if (!strcmp(string, "temp:")) { printf("Temperature: %d\n", val); - } - if (last_time != time_now) { - insert_rec(db, INSERT_TEMP_TEMPL, val, WTHR_STATION_ID, time_now); + if (last_time != time_now) { + insert_rec(db, INSERT_TEMP_TEMPL, val, WTHR_STATION_ID, time_now); + } } if (!strcmp(string, "humi:")) { printf("Relative Humidity: %d\n", val);