summaryrefslogtreecommitdiff
path: root/src/resources
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-06 23:01:49 +0100
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2012-02-06 23:08:57 +0100
commit367b2e8b01c42c34c7782c4410db359c2b3ca060 (patch)
treea8bf2688c8cd2d0fd0177d294d5a52e33b5a6044 /src/resources
parent93d7f788d24f96966b69250267557ba7b9fcd442 (diff)
downloadmana-367b2e8b01c42c34c7782c4410db359c2b3ca060.tar.gz
mana-367b2e8b01c42c34c7782c4410db359c2b3ca060.tar.bz2
mana-367b2e8b01c42c34c7782c4410db359c2b3ca060.tar.xz
mana-367b2e8b01c42c34c7782c4410db359c2b3ca060.zip
Fixed searching for wallpapers on 64-bit machines
The check whether a filename contains any '%' character was failing because the 'unsigned int separator' was too small to hold std::string::npos. Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/resources')
-rw-r--r--src/resources/wallpaper.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp
index 5f5cc29a..727ccced 100644
--- a/src/resources/wallpaper.cpp
+++ b/src/resources/wallpaper.cpp
@@ -103,12 +103,10 @@ void Wallpaper::loadWallpapers()
// First, get the base filename of the image:
std::string filename = *i;
- unsigned int separator = filename.rfind("_");
- filename = filename.substr(0, separator);
+ filename = filename.substr(0, filename.rfind("_"));
// Check that the base filename doesn't have any '%' markers.
- separator = filename.find("%");
- if (separator == std::string::npos)
+ if (filename.find("%") == std::string::npos)
{
// Then, append the width and height search mask.
filename.append("_%dx%d.png");