aboutsummaryrefslogtreecommitdiff
path: root/dbar.c
diff options
context:
space:
mode:
authorNathan Reiner <nathan@nathanreiner.xyz>2023-03-20 22:02:17 +0100
committerNathan Reiner <nathan@nathanreiner.xyz>2023-03-20 22:02:17 +0100
commit65dc155a9c67f3f99a2e4a097182a1855a1dcf12 (patch)
tree1f62e46bdbd2fb2d8fa7490d11b229d25d6d0630 /dbar.c
parentda69d87dab1806430d7f166ddd1f1da29a0b7079 (diff)
make progname allocation bound to bar
Diffstat (limited to 'dbar.c')
-rw-r--r--dbar.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/dbar.c b/dbar.c
index 8fdfd8c..ddbc42d 100644
--- a/dbar.c
+++ b/dbar.c
@@ -26,7 +26,7 @@ struct Bar {
uint32_t clients;
uint32_t active;
uint32_t layout;
- char *progname;
+ char progname[256];
uint32_t update_count;
Canvas *canvas;
struct zdwl_output_v1 *dwl_output;
@@ -333,11 +333,7 @@ dwl_output_title(void *data, struct zdwl_output_v1 *zdwl_output_v1, const char *
{
Bar *bar = data;
- if (bar->progname)
- free(bar->progname);
-
- bar->progname = malloc(strlen(title));
- strcpy(bar->progname, title);
+ strncpy(bar->progname, title, 256);
}