summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Skyttä <ville.skytta@iki.fi>2011-11-05 23:21:25 +0200
committerVille Skyttä <ville.skytta@iki.fi>2011-11-05 23:21:25 +0200
commitedba905a3981042c8f1b3f51ac66a32a451dc482 (patch)
treeec7f0e20f3746f05ba0c2a9df816df3d3ba521ce
parent68c9d1e1fca93852fd20465456de41141afc03b6 (diff)
downloadvdr-plugin-osdteletext-edba905a3981042c8f1b3f51ac66a32a451dc482.tar.gz
vdr-plugin-osdteletext-edba905a3981042c8f1b3f51ac66a32a451dc482.tar.bz2
Reduce scope of some variables.
-rw-r--r--txtrecv.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/txtrecv.c b/txtrecv.c
index 5acf2c8..a461d05 100644
--- a/txtrecv.c
+++ b/txtrecv.c
@@ -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) ) {