From 5a5bb02d01fce26195cff8e78e2d106b770c6507 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 24 Sep 2019 09:18:26 +0200 Subject: humidity: wip --- anzeige.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'anzeige.c') diff --git a/anzeige.c b/anzeige.c index 67a2046..311b4ac 100644 --- a/anzeige.c +++ b/anzeige.c @@ -112,6 +112,17 @@ int main(int argc, char **argv) turn_off_display(); return EXIT_FAILURE; } + if (text_buffer + TEXT_BUFFER_LENGTH - text_buffer_end > 0) + text_buffer_end += snprintf(text_buffer_end, text_buffer + TEXT_BUFFER_LENGTH - text_buffer_end, "; "); + text_buffer_end = gadgets_retrieve_humidity(text_buffer_end, text_buffer + TEXT_BUFFER_LENGTH - text_buffer_end, temperature, humidity); + if (text_buffer_end == NULL) { + fprintf(stderr, "gadgets_retrieve_humidity failed\n"); + free(text_buffer); + turn_off_display(); + return EXIT_FAILURE; + } + printf("%s\n", text_buffer); + return 0; struct tm time_struct; memset(&time_struct, 0, sizeof(time_struct)); localtime_r(&next_update, &time_struct); -- cgit v1.2.3-70-g09d2