Commit: b68280d6efa621a340cc06cd581a55ebbf914504
Parent: 27a1a9cae9a442439218de82504fd0e00132a230
Author: Randy Palamar
Date: Sun, 15 Oct 2023 00:47:33 -0600
cleanup ugly infinite for loop
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/status.c b/status.c
@@ -145,11 +145,11 @@ statusinit(void)
static void
statusloop(void)
{
- unsigned int i;
+ unsigned int i = 0;
struct Block *b;
struct timespec t;
- for (i = 1; ; i++) {
+ for (;;) {
sigprocmask(SIG_UNBLOCK, &blocksigmask, NULL);
t.tv_sec = INTERVAL_SEC;
t.tv_nsec = INTERVAL_NANO;
@@ -161,6 +161,7 @@ statusloop(void)
updateblock(b);
if (dirty)
updatestatus();
+ i++;
}
}