diff options
| author | bakkeby <[email protected]> | 2021-03-31 19:41:46 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2021-03-31 19:41:46 +0200 |
| commit | 4b22fdc0c383daf2612f416f81a6f391170bf213 (patch) | |
| tree | 40aa3684bfa322a21de77e5128f063a3238eadc3 /patch | |
| parent | 647c5935b347cf234a0d6b8186e7f083a2202a65 (diff) | |
| download | dwm-flexipatch-4b22fdc0c383daf2612f416f81a6f391170bf213.tar.gz dwm-flexipatch-4b22fdc0c383daf2612f416f81a6f391170bf213.zip | |
Incomplete status2d fragments protection
Diffstat (limited to 'patch')
| -rw-r--r-- | patch/bar_status2d.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/patch/bar_status2d.c b/patch/bar_status2d.c index 54e008d..e0d20a0 100644 --- a/patch/bar_status2d.c +++ b/patch/bar_status2d.c @@ -87,8 +87,8 @@ drawstatusbar(BarArg *a, char* stext) char *text; char *p; Clr oldbg, oldfg; - len = strlen(stext) + 1; - if (!(text = (char*) malloc(sizeof(char)*len))) + len = strlen(stext); + if (!(text = (char*) malloc(sizeof(char)*(len + 1)))) die("malloc"); p = text; #if BAR_STATUSCMD_PATCH @@ -203,6 +203,7 @@ drawstatusbar(BarArg *a, char* stext) } text = text + i + 1; + len -= i + 1; i=-1; isCode = 0; } |
