aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortorrinfail <torrinfail@gmail.com>2020-08-11 20:04:51 -0700
committerGitHub <noreply@github.com>2020-08-11 20:04:51 -0700
commitd2e6d20ebf269f1074e7afc206d4c3d3b556fc9f (patch)
tree515372a1953aff033804d6c4c3f52ae5d1ab1acf
parent1b2e50c6c53c5d539c04b0e30c7d7cd5f08a5a3a (diff)
parent4d92b6ca6caae215a79f00d88404c018b9eac15f (diff)
Merge pull request #15 from tomboehmer/issue9
Fixes #9 - determine the size of the status buffer based on the number of blocks
-rw-r--r--dwmblocks.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dwmblocks.c b/dwmblocks.c
index 8668f04..21c1482 100644
--- a/dwmblocks.c
+++ b/dwmblocks.c
@@ -6,6 +6,7 @@
#include<X11/Xlib.h>
#define LENGTH(X) (sizeof(X) / sizeof (X[0]))
#define CMDLENGTH 50
+#define STATUSLENGTH (LENGTH(blocks) * CMDLENGTH + 1)
typedef struct {
char* icon;
@@ -33,7 +34,7 @@ static Display *dpy;
static int screen;
static Window root;
static char statusbar[LENGTH(blocks)][CMDLENGTH] = {0};
-static char statusstr[2][256];
+static char statusstr[2][STATUSLENGTH];
static int statusContinue = 1;
static void (*writestatus) () = setroot;