diff options
| -rw-r--r-- | txtrecv.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -65,11 +65,12 @@ int Storage::cleanSubDir(const char *dir) { static bool reportedError=false; //avoid filling up syslog DIR *d=opendir(dir); bool hadError=false; - int bytesDeleted=0, filesize; + int bytesDeleted=0; if (d) { struct dirent *txtfile, path; struct stat txtfilestat; char fullPath[PATH_MAX]; + int filesize; while ( (!readdir_r(d, &path, &txtfile) && txtfile != NULL) ) { int len=strlen(txtfile->d_name); //check that the file end with .vtx to avoid accidents and disasters @@ -128,9 +129,9 @@ void Storage::freeSpace() { time_t min=time(0); char minDir[PATH_MAX]; char fullPath[PATH_MAX]; - int haveDir=0; DIR *top=opendir(getRootDir()); if (top) { + int haveDir=0; struct dirent *chandir, path; struct stat chandirstat; while ( (!readdir_r(top, &path, &chandir) && chandir != NULL) ) { |
