aboutsummaryrefslogtreecommitdiff
path: root/dbar.c
diff options
context:
space:
mode:
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);
}