diff options
author | June McEnroe <june@causal.agency> | 2017-04-30 14:02:55 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2017-04-30 14:02:55 -0400 |
commit | fd86933a20196b3784cb193a2ec1e52b389c4b4d (patch) | |
tree | 2d54d8570c8f179876a34eb8c0748493677e65d3 | |
parent | Clean up error strings in bri (diff) | |
download | src-fd86933a20196b3784cb193a2ec1e52b389c4b4d.tar.gz src-fd86933a20196b3784cb193a2ec1e52b389c4b4d.zip |
Clean up clock
Diffstat (limited to '')
-rwxr-xr-x | .bin/clock.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/.bin/clock.c b/.bin/clock.c index f153126a..288884d8 100755 --- a/.bin/clock.c +++ b/.bin/clock.c @@ -10,16 +10,16 @@ exec cc -Wall -Wextra -pedantic $@ -o $(dirname $0)/clock $0 #include <err.h> int main() { - time_t timestamp = time(NULL); - if (timestamp < 0) err(EX_OSERR, "time"); + time_t ts = time(NULL); + if (ts < 0) err(EX_OSERR, "time"); - struct tm *clock = localtime(×tamp); - if (!clock) err(EX_OSERR, "localtime"); + struct tm *time = localtime(&ts); + if (!time) err(EX_OSERR, "localtime"); - int hour = clock->tm_hour; + int hour = time->tm_hour; int next = (hour + 1) % 24; - switch ((clock->tm_min + 5) / 10) { + switch ((time->tm_min + 5) / 10) { case 0: printf("..%02d..\n", hour); break; case 1: printf(".%02d...\n", hour); break; case 2: printf("%02d....\n", hour); break; @@ -29,5 +29,5 @@ int main() { case 6: printf("..%02d..\n", next); break; } - return 0; + return EX_OK; } |