diff options
-rw-r--r-- | binstatus.c | 18 |
1 files changed, 1 insertions, 17 deletions
diff --git a/binstatus.c b/binstatus.c index 9b29c29..edce1ec 100644 --- a/binstatus.c +++ b/binstatus.c @@ -59,23 +59,7 @@ formatstring(char *status, int *time) int converthour(int hour) { - // is there a better way? - switch (hour) - { - case 0: return 12; - case 13: return 1; - case 14: return 2; - case 15: return 3; - case 16: return 4; - case 17: return 5; - case 18: return 6; - case 19: return 7; - case 20: return 8; - case 21: return 9; - case 22: return 10; - case 23: return 11; - default: return hour; - } + return (hour - 12 < 0) ? 0 : hour - 12; } int |