From cc42c7ac59b1ce403d117fb73a761668425d930b Mon Sep 17 00:00:00 2001 From: louie Date: Thu, 2 Jul 2020 20:40:57 -0700 Subject: Fixed small strcat bug --- draw.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'draw.c') diff --git a/draw.c b/draw.c index fe41aa7..8f0d09f 100644 --- a/draw.c +++ b/draw.c @@ -269,21 +269,24 @@ void launch_entry(){ char *flags = get_gflags(g[g_hover]); char *path = get_epath(e[e_hover]); int mode = get_compmode(); + char full_command[BUF_LEN]; //if the entry is an executable file (doesn't have a launcher) if(!(strcmp(program, "./"))) system(path); else{ if(mode != 0) path = compat_convert(path, mode); - strcat(program, " \""); + full_command[0] = '\0'; + strcat(full_command, program); + strcat(full_command, " \""); if(flags[0] !='\0'){ - strcat(program, flags); - strcat(program, "\""); - strcat(program, " \""); + strcat(full_command, flags); + strcat(full_command, "\""); + strcat(full_command, " \""); } - strcat(program, path); - strcat(program, "\""); - system(program); + strcat(full_command, path); + strcat(full_command, "\""); + system(full_command); } return; -- cgit