diff options
-rw-r--r-- | anzeige.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -110,7 +110,10 @@ int main(int argc, char **argv) turn_off_display(); return EXIT_FAILURE; } - for (int i=0; i<5; i++) { + struct tm time_struct; + memset(&time_struct, 0, sizeof(time_struct)); + localtime_r(&next_update, &time_struct); + for (int i = 0; i < (time_struct . tm_wday + 6) % 7 + 1; i++) { if (text_buffer + TEXT_BUFFER_LENGTH - text_buffer_end <= 0) break; text_buffer_end += snprintf(text_buffer_end, text_buffer + TEXT_BUFFER_LENGTH - text_buffer_end, "%c%c%c%c", 0xEE, i==0 ? 0x01 : 0x03, 0xEE, i==0 ? 0x02 : 0x04); |