Fix bar
This commit is contained in:
parent
e89afb001e
commit
139d1c3942
34
dwm.c
34
dwm.c
|
@ -738,29 +738,25 @@ int
|
||||||
drawstatusbar(Monitor *m, int bh, int extra, char* stext) {
|
drawstatusbar(Monitor *m, int bh, int extra, char* stext) {
|
||||||
int ret, i, w, w2, x, x2, len, len2;
|
int ret, i, w, w2, x, x2, len, len2;
|
||||||
short isCode = 0, isCode2 = 0;
|
short isCode = 0, isCode2 = 0;
|
||||||
char *text;
|
char *text, *text2;
|
||||||
char *text2;
|
char *p, *p2;
|
||||||
char *p;
|
|
||||||
char *p2;
|
|
||||||
char stext2[1024];
|
char stext2[1024];
|
||||||
|
|
||||||
if (extra) {
|
char *st = strchr(stext, statussep);
|
||||||
char *st = strchr(stext, statussep);
|
if (st) {
|
||||||
if (st) {
|
*st = '\0'; st++;
|
||||||
*st = '\0'; st++;
|
strncpy(stext2, st, sizeof(stext2) - 1);
|
||||||
strncpy(stext2, st, sizeof(stext2) - 1);
|
} else {
|
||||||
} else {
|
stext2[0] = '\0';
|
||||||
stext2[0] = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
len2 = strlen(stext2) + 1;
|
|
||||||
if (!(text2 = (char*) malloc(sizeof(char)*len2)))
|
|
||||||
die("malloc");
|
|
||||||
|
|
||||||
p2 = text2;
|
|
||||||
memcpy(text2, stext2, len2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
len2 = strlen(stext2) + 1;
|
||||||
|
if (!(text2 = (char*) malloc(sizeof(char)*len2)))
|
||||||
|
die("malloc");
|
||||||
|
|
||||||
|
p2 = text2;
|
||||||
|
memcpy(text2, stext2, len2);
|
||||||
|
|
||||||
len = strlen(stext) + 1;
|
len = strlen(stext) + 1;
|
||||||
if (!(text = (char*) malloc(sizeof(char)*len)))
|
if (!(text = (char*) malloc(sizeof(char)*len)))
|
||||||
die("malloc");
|
die("malloc");
|
||||||
|
|
Loading…
Reference in New Issue