Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
utils: trivial cleanups
  • Loading branch information
perexg committed Dec 5, 2014
1 parent 5ba389b commit d254f52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/utils.c
Expand Up @@ -498,14 +498,14 @@ makedirs ( const char *inpath, int mode )
int err, ok;
size_t x;
struct stat st;
char path[512];
char *path;

if (!inpath || !*inpath) return -1;

x = 1;
ok = 1;
strncpy(path, inpath, sizeof(path)-1);
path[sizeof(path)-1] = '\0';
path = alloca(strlen(inpath) + 1);
strcpy(path, inpath);
while(ok) {
ok = path[x];
if (path[x] == '/' || !path[x]) {
Expand Down Expand Up @@ -535,7 +535,7 @@ rmtree ( const char *path )
int err = 0;
struct dirent de, *der;
struct stat st;
char buf[512];
char buf[PATH_MAX];
DIR *dir = opendir(path);
if (!dir) return -1;
while (!readdir_r(dir, &de, &der) && der) {
Expand Down

0 comments on commit d254f52

Please sign in to comment.