[hackers] [slock] increasing for loops are idiomatic || Markus Teich

From: <git_AT_suckless.org>
Date: Fri, 2 Sep 2016 11:49:05 +0200 (CEST)

commit a55594fdd69fcfcc10b8c9624d5aba298969d713
Author: Markus Teich <markus.teich_AT_stusta.mhn.de>
AuthorDate: Fri Sep 2 11:49:02 2016 +0200
Commit: Markus Teich <markus.teich_AT_stusta.mhn.de>
CommitDate: Fri Sep 2 11:49:02 2016 +0200

    increasing for loops are idiomatic

diff --git a/slock.c b/slock.c
index 83d426a..08ada6f 100644
--- a/slock.c
+++ b/slock.c
_AT_@ -274,7 +274,7 @@ lockscreen(Display *dpy, int screen)
         XDefineCursor(dpy, lock->win, invisible);
 
         /* Try to grab mouse pointer *and* keyboard for 600ms, else fail the lock */
- for (i = 6, ptgrab = kbgrab = -1; i; --i) {
+ for (i = 0, ptgrab = kbgrab = -1; i < 6; i++) {
                 if (ptgrab != GrabSuccess) {
                         ptgrab = XGrabPointer(dpy, lock->root, False,
                                  ButtonPressMask | ButtonReleaseMask |
Received on Fri Sep 02 2016 - 11:49:05 CEST

This archive was generated by hypermail 2.3.0 : Fri Sep 02 2016 - 12:00:51 CEST