]> git.armaanb.net Git - dwmblocks.git/commitdiff
Merge pull request #15 from tomboehmer/issue9
authortorrinfail <torrinfail@gmail.com>
Wed, 12 Aug 2020 03:04:51 +0000 (20:04 -0700)
committerGitHub <noreply@github.com>
Wed, 12 Aug 2020 03:04:51 +0000 (20:04 -0700)
Fixes #9 - determine the size of the status buffer based on the number of blocks

dwmblocks.c

index 8668f042d77bea8510570564fe82f78de5bc5463..21c14825f9ddc595d49481701899a79e1d732b8c 100644 (file)
@@ -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;