summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/chattab.cpp3
-rw-r--r--src/main.cpp2
-rw-r--r--src/resources/wallpaper.cpp17
3 files changed, 16 insertions, 6 deletions
diff --git a/src/gui/widgets/chattab.cpp b/src/gui/widgets/chattab.cpp
index f3258f04..1879a918 100644
--- a/src/gui/widgets/chattab.cpp
+++ b/src/gui/widgets/chattab.cpp
@@ -215,7 +215,8 @@ void ChatTab::chatInput(std::string &msg)
{
trim(msg);
- if (msg.empty()) return;
+ if (msg.empty())
+ return;
// Check for item link
std::string::size_type start = msg.find('[');
diff --git a/src/main.cpp b/src/main.cpp
index 0ef7289a..d113f3e4 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -967,7 +967,7 @@ int main(int argc, char *argv[])
#ifdef TMWSERV_SUPPORT
Net::initialize();
- TmwServ::GeneralHandler *generalHandler = new TmwServ::GeneralHandler;
+ new TmwServ::GeneralHandler; // Currently registers itself
#else
SDLNet_Init();
Network *network = new Network;
diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp
index 24c6fff2..2c8c4a00 100644
--- a/src/resources/wallpaper.cpp
+++ b/src/resources/wallpaper.cpp
@@ -54,26 +54,35 @@ void Wallpaper::loadWallpapers()
{
char **imgs = PHYSFS_enumerateFiles(WALLPAPER_FOLDER);
char **i;
- int baseLen = strlen(WALLPAPER_BASE), width, height;
+ size_t baseLen = strlen(WALLPAPER_BASE);
+ int width;
+ int height;
wallpapers.clear();
haveBackup = false;
for (i = imgs; *i != NULL; i++)
+ {
if (strncmp(*i, WALLPAPER_BASE, baseLen) == 0)
+ {
if (strlen(*i) == baseLen + 4)
+ {
if (haveBackup)
logger->log("Duplicate default wallpaper!");
- else haveBackup = true;
- else if (sscanf(*i, WALLPAPER_BASE "_%dx%d.png", &width,
- &height) == 2)
+ else
+ haveBackup = true;
+ }
+ else if (sscanf(*i, WALLPAPER_BASE "_%dx%d.png",
+ &width, &height) == 2)
{
struct wallpaper wp;
wp.width = width;
wp.height = height;
wallpapers.push_back(wp);
}
+ }
+ }
PHYSFS_freeList(imgs);