sizeof will work for char

This commit is contained in:
Ashish Kumar Yadav 2020-12-09 02:13:39 +05:30
parent b43e93b418
commit 547bb3d699

View file

@ -14,8 +14,6 @@
#define NILL INT_MIN #define NILL INT_MIN
#define LOCKFILE "/tmp/dwmblocks.pid" #define LOCKFILE "/tmp/dwmblocks.pid"
#define LENGTH(X) (sizeof X / sizeof X[0])
typedef struct { typedef struct {
char *const pathu; char *const pathu;
char *const pathc; char *const pathc;
@ -360,7 +358,7 @@ main(int argc, char *argv[])
delimlength = strlen(delim) + 1; delimlength = strlen(delim) + 1;
} else { } else {
delim = DELIMITER; delim = DELIMITER;
delimlength = LENGTH(DELIMITER); delimlength = sizeof DELIMITER;
} }
if (!(dpy = XOpenDisplay(NULL))) { if (!(dpy = XOpenDisplay(NULL))) {
fputs("Error: could not open display.\n", stderr); fputs("Error: could not open display.\n", stderr);