summary refs log tree commit diff
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2017-01-20 00:06:28 -0500
committerJune McEnroe <june@causal.agency>2017-01-20 00:06:28 -0500
commit53843c9613c5c6fe6513b6383c018b798e79277f (patch)
tree9e74174e08de02f169a046b0e49e6795e7557a5d
parentSwitch clock to 6-minute graduations (diff)
downloadsrc-53843c9613c5c6fe6513b6383c018b798e79277f.tar.gz
src-53843c9613c5c6fe6513b6383c018b798e79277f.zip
Modulo next hour by 24 in clock
-rwxr-xr-x.bin/clock.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/.bin/clock.c b/.bin/clock.c
index 9fcd5ac9..d513fe75 100755
--- a/.bin/clock.c
+++ b/.bin/clock.c
@@ -15,7 +15,7 @@ int main() {
     if (!clock) err(EX_OSERR, "localtime");
 
     int hour = clock->tm_hour;
-    int next = clock->tm_hour + 1;
+    int next = (hour + 1) % 24;
 
     switch ((clock->tm_min + 3) / 6) {
         case  0: printf("....%02d....\n", hour); break;