Fixed buffer size.

This commit is contained in:
Jeremy Sowden
2019-08-06 11:04:05 +01:00
committed by Carlos R. Mafra
parent 41193bdacd
commit a12f0d453a
+2 -2
View File
@@ -1392,7 +1392,7 @@ void wClipIconPaint(WAppIcon *aicon)
WMColor *color;
Window win = aicon->icon->core->window;
int length, nlength;
char *ws_name, ws_number[10];
char *ws_name, ws_number[sizeof scr->current_workspace * CHAR_BIT / 3 + 1];
int ty, tx;
wIconPaint(aicon->icon);
@@ -1400,7 +1400,7 @@ void wClipIconPaint(WAppIcon *aicon)
length = strlen(workspace->name);
ws_name = wmalloc(length + 1);
snprintf(ws_name, length + 1, "%s", workspace->name);
snprintf(ws_number, sizeof(ws_number), "%i", scr->current_workspace + 1);
snprintf(ws_number, sizeof ws_number, "%u", scr->current_workspace + 1);
nlength = strlen(ws_number);
if (wPreferences.flags.noclip || !workspace->clip->collapsed)