diff options
author | Erich Eckner <git@eckner.net> | 2018-11-07 10:43:33 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-11-07 10:43:33 +0100 |
commit | 50d7954298e19d3c15584416862c5e273a5d02fa (patch) | |
tree | ffb23b4c12cab9391958ae9ea6b8d93f5153166e /anzeige.c | |
parent | 68f3d76a5f48fb87f6c6e31980269444bad1069b (diff) | |
download | anzeige-50d7954298e19d3c15584416862c5e273a5d02fa.tar.xz |
anzeige.c: Wagonanzahl Wochentagsabhängig
Diffstat (limited to 'anzeige.c')
-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); |