doing it in a shorter way
authorAnselm R. Garbe <garbeam@gmail.com>
Sat, 3 Nov 2007 20:14:04 +0000 (21:14 +0100)
committerAnselm R. Garbe <garbeam@gmail.com>
Sat, 3 Nov 2007 20:14:04 +0000 (21:14 +0100)
dwm.c

diff --git a/dwm.c b/dwm.c
index 044177d..1266e46 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -1321,10 +1321,8 @@ run(void) {
                                        *p = '\0';
                                        offset = 0;
                                }
-                               else if(offset + r < len - 1)
-                                       offset += r;
                                else
-                                       offset = 0;
+                                       offset = (offset + r < len - 1) ? offset + r : 0;
                        }
                        drawbar();
                }