Skip to content
Snippets Groups Projects
Commit 0b49021a authored by Chris West (Faux)'s avatar Chris West (Faux)
Browse files

399ccdeb caused a crash on non-existent directories on the command line

parent 399ccdeb
No related merge requests found
...@@ -367,7 +367,7 @@ int calc_key(int ch) { ...@@ -367,7 +367,7 @@ int calc_key(int ch) {
int calc_process() { int calc_process() {
char *path, *name; char *path = NULL, *name = NULL;
struct stat fs; struct stat fs;
struct dir *t; struct dir *t;
int n; int n;
...@@ -494,7 +494,7 @@ int calc_process() { ...@@ -494,7 +494,7 @@ int calc_process() {
/* something went wrong... */ /* something went wrong... */
freedir(root); freedir(root);
calc_fail: calc_fail:
if(!path[1] && strcmp(name, ".")) if(name && path && !path[1] && strcmp(name, "."))
free(name); free(name);
free(path); free(path);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment