Fixed malloc for pre_display_exec

This commit is contained in:
Scoopta 2024-01-21 00:24:14 -08:00
parent 7d84a6c9f3
commit 421ce981d8

View File

@ -442,7 +442,7 @@ static GtkWidget* create_label(char* mode, char* text, char* search_text, char*
char* tmp_space = space; char* tmp_space = space;
for(; (tmp_space = strchr(tmp_space + 1, ' ')) != NULL; ++space_count); 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[0] = cmd;
args[1] = space + 1; args[1] = space + 1;
args[space_count + 2] = NULL; args[space_count + 2] = NULL;