]> git.armaanb.net Git - dmenu.git/commitdiff
signed ints, ignore negative -l value
authorConnor Lane Smith <cls@lubutu.com>
Wed, 18 Aug 2010 16:33:34 +0000 (17:33 +0100)
committerConnor Lane Smith <cls@lubutu.com>
Wed, 18 Aug 2010 16:33:34 +0000 (17:33 +0100)
dmenu.c

diff --git a/dmenu.c b/dmenu.c
index 9b6a3825a8e7f10a0a846a38599477bb7e49574c..a5a4cdd78a6ad4f1c4618289618acf4130a1c59f 100644 (file)
--- a/dmenu.c
+++ b/dmenu.c
@@ -39,6 +39,10 @@ static void setup(void);
 static void usage(void);
 
 static char text[BUFSIZ];
+static int bh, mw, mh;
+static int inputw = 0;
+static int promptw;
+static int lines = 0;
 static size_t cursor = 0;
 static const char *font = NULL;
 static const char *prompt = NULL;
@@ -46,10 +50,6 @@ static const char *normbgcolor = "#cccccc";
 static const char *normfgcolor = "#000000";
 static const char *selbgcolor  = "#0066ff";
 static const char *selfgcolor  = "#ffffff";
-static unsigned int bh, mw, mh;
-static unsigned int inputw = 0;
-static unsigned int lines = 0;
-static unsigned int promptw;
 static unsigned long normcol[ColLast];
 static unsigned long selcol[ColLast];
 static Atom utf8;
@@ -444,6 +444,7 @@ setup(void) {
 
        /* menu geometry */
        bh = dc->font.height + 2;
+       lines = MAX(lines, 0);
        mh = (lines + 1) * bh;
 #ifdef XINERAMA
        if((info = XineramaQueryScreens(dc->dpy, &n))) {