From 421ce981d88b7f0ba9290920deeb3846678f4b01 Mon Sep 17 00:00:00 2001 From: Scoopta Date: Sun, 21 Jan 2024 00:24:14 -0800 Subject: [PATCH] Fixed malloc for pre_display_exec --- src/wofi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wofi.c b/src/wofi.c index a849c0e..9048616 100644 --- a/src/wofi.c +++ b/src/wofi.c @@ -442,7 +442,7 @@ static GtkWidget* create_label(char* mode, char* text, char* search_text, char* char* tmp_space = space; for(; (tmp_space = strchr(tmp_space + 1, ' ')) != NULL; ++space_count); - char** args = malloc((sizeof(char*) * space_count) + 2); + char** args = malloc((sizeof(char*) * (space_count + 2))); args[0] = cmd; args[1] = space + 1; args[space_count + 2] = NULL;