diff options
author | Connor Lane Smith <cls@lubutu.com> | 2010-08-18 17:33:34 +0100 |
---|---|---|
committer | Connor Lane Smith <cls@lubutu.com> | 2010-08-18 17:33:34 +0100 |
commit | e4fdaba88d94d049c4140593cb2fd3208c8cf0f1 (patch) | |
tree | 072a7029c0f5cfa388ae1ac469d1875fe05efc25 | |
parent | 849f1dd7a3ac1fc6d6a88a9e2b7d7dedbcd0befc (diff) |
signed ints, ignore negative -l value
-rw-r--r-- | dmenu.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -39,6 +39,10 @@ static void setup(void); | |||
39 | static void usage(void); | 39 | static void usage(void); |
40 | 40 | ||
41 | static char text[BUFSIZ]; | 41 | static char text[BUFSIZ]; |
42 | static int bh, mw, mh; | ||
43 | static int inputw = 0; | ||
44 | static int promptw; | ||
45 | static int lines = 0; | ||
42 | static size_t cursor = 0; | 46 | static size_t cursor = 0; |
43 | static const char *font = NULL; | 47 | static const char *font = NULL; |
44 | static const char *prompt = NULL; | 48 | static const char *prompt = NULL; |
@@ -46,10 +50,6 @@ static const char *normbgcolor = "#cccccc"; | |||
46 | static const char *normfgcolor = "#000000"; | 50 | static const char *normfgcolor = "#000000"; |
47 | static const char *selbgcolor = "#0066ff"; | 51 | static const char *selbgcolor = "#0066ff"; |
48 | static const char *selfgcolor = "#ffffff"; | 52 | static const char *selfgcolor = "#ffffff"; |
49 | static unsigned int bh, mw, mh; | ||
50 | static unsigned int inputw = 0; | ||
51 | static unsigned int lines = 0; | ||
52 | static unsigned int promptw; | ||
53 | static unsigned long normcol[ColLast]; | 53 | static unsigned long normcol[ColLast]; |
54 | static unsigned long selcol[ColLast]; | 54 | static unsigned long selcol[ColLast]; |
55 | static Atom utf8; | 55 | static Atom utf8; |
@@ -444,6 +444,7 @@ setup(void) { | |||
444 | 444 | ||
445 | /* menu geometry */ | 445 | /* menu geometry */ |
446 | bh = dc->font.height + 2; | 446 | bh = dc->font.height + 2; |
447 | lines = MAX(lines, 0); | ||
447 | mh = (lines + 1) * bh; | 448 | mh = (lines + 1) * bh; |
448 | #ifdef XINERAMA | 449 | #ifdef XINERAMA |
449 | if((info = XineramaQueryScreens(dc->dpy, &n))) { | 450 | if((info = XineramaQueryScreens(dc->dpy, &n))) { |