summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-12-06 16:19:56 +0100
committerlouis <louis.braun@gmx.de>2013-12-06 16:19:56 +0100
commit67b97d1b9212e9266d0c1809882e603bafaa5be9 (patch)
treecb651f29f5454ae07ef8c1154cbad6276db67458
parentedbf248cd46ba7d6e4b828713a957d5e7efd6513 (diff)
downloadskin-nopacity-67b97d1b9212e9266d0c1809882e603bafaa5be9.tar.gz
skin-nopacity-67b97d1b9212e9266d0c1809882e603bafaa5be9.tar.bz2
fixed a bug in cImageLoader::FirstImageInFolder()
-rw-r--r--HISTORY5
-rw-r--r--imageloader.c10
2 files changed, 10 insertions, 5 deletions
diff --git a/HISTORY b/HISTORY
index 219b11a..0088052 100644
--- a/HISTORY
+++ b/HISTORY
@@ -383,3 +383,8 @@ Version 1.0.0
- fixed a crash with dvb cards which deliver negative signal values
- added theme darkredNG
- updated ca_es po file
+
+Version 1.0.1
+
+- fixed a bug in cImageLoader::FirstImageInFolder()
+
diff --git a/imageloader.c b/imageloader.c
index c368370..047502b 100644
--- a/imageloader.c
+++ b/imageloader.c
@@ -153,12 +153,12 @@ bool cImageLoader::FirstImageInFolder(cString Path, cString Extension, cString *
while (file = readdir(folder)) {
if (endswith(file->d_name, *Extension)) {
std::string fileName = file->d_name;
- if (!fileName.compare(fileName.size()-8, 8, "_vdr.jpg"))
+ int strlen = fileName.length();
+ if (strlen < 8)
continue;
- if (fileName.length() > 4)
- fileName = fileName.substr(0, fileName.length() - 4);
- else
- return false;
+ if (!fileName.compare(strlen-8, 8, "_vdr.jpg"))
+ continue;
+ fileName = fileName.substr(0, strlen - 4);
*recImage = fileName.c_str();
return true;
}