summaryrefslogtreecommitdiff
path: root/draw.c
diff options
context:
space:
mode:
authorlshprung <lshprung@yahoo.com>2020-11-22 11:30:36 -0800
committerlshprung <lshprung@yahoo.com>2020-11-22 11:30:36 -0800
commitd5e9b653d91556e500b4659ee6895a117d919c85 (patch)
tree6f576e316595d2dd6f2d26fcfc850fbc8fd3cff0 /draw.c
parent4313a39544cde16e5750f5affc1b7702770c1699 (diff)
Fixed potential memory error
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/draw.c b/draw.c
index c72eb6e..7afcd94 100644
--- a/draw.c
+++ b/draw.c
@@ -48,7 +48,7 @@ int g_offset = 0;
int e_offset = 0;
int main(int argc, char **argv){
- char *cfg_path;
+ char cfg_path[BUF_LEN];
int input;
char full_command[BUF_LEN]; //what will be executed
int prev_width; //used to check if the window was resized
@@ -56,8 +56,8 @@ int main(int argc, char **argv){
int i;
//if a config path was given as an argument, set it accordingly
- if(argc > 2 && (!strcmp(argv[1], "-c") || !strcmp(argv[1], "--cfg_path"))) cfg_path = argv[2];
- else cfg_path = find_config();
+ if(argc > 2 && (!strcmp(argv[1], "-c") || !strcmp(argv[1], "--cfg_path"))) strcpy(cfg_path, argv[2]);
+ else strcpy(cfg_path, find_config());
//Fill Groups
cfg_interp(cfg_path); //read the contents of the cfg file