[hackers] [dmenu] signed ints, ignore negative -l value || Connor Lane Smith

From: <hg_AT_suckless.org>
Date: Wed, 18 Aug 2010 16:33:39 +0000 (UTC)

changeset: 360:67a85d8803d8
tag: tip
user: Connor Lane Smith <cls_AT_lubutu.com>
date: Wed Aug 18 17:33:34 2010 +0100
files: dmenu.c
description:
signed ints, ignore negative -l value

diff -r ccb2b92086bf -r 67a85d8803d8 dmenu.c
--- a/dmenu.c Thu Aug 12 15:35:51 2010 +0100
+++ b/dmenu.c Wed Aug 18 17:33:34 2010 +0100
@@ -39,6 +39,10 @@
 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 *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 @@
 
         /* menu geometry */
         bh = dc->font.height + 2;
+ lines = MAX(lines, 0);
         mh = (lines + 1) * bh;
 #ifdef XINERAMA
         if((info = XineramaQueryScreens(dc->dpy, &n))) {
Received on Wed Aug 18 2010 - 18:33:39 CEST

This archive was generated by hypermail 2.2.0 : Wed Aug 18 2010 - 18:36:05 CEST