diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_fr> | 2010-05-21 19:45:32 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_fr> | 2010-05-21 19:56:53 +0200 |
commit | c6168a565b14887f1ab7fdba9e0e5cd0a9f1ca1a (patch) | |
tree | 629fb6744f65bfadadf9237d85610660997f00b8 /src | |
parent | 2405b9500e0f87da4e3623c8f083247036c51297 (diff) | |
download | mana-client-c6168a565b14887f1ab7fdba9e0e5cd0a9f1ca1a.tar.gz mana-client-c6168a565b14887f1ab7fdba9e0e5cd0a9f1ca1a.tar.bz2 mana-client-c6168a565b14887f1ab7fdba9e0e5cd0a9f1ca1a.tar.xz mana-client-c6168a565b14887f1ab7fdba9e0e5cd0a9f1ca1a.zip |
Avoid a crash when the updateHost is set to nothing in the config file.
Reviewed-by: Jaxad0127
Diffstat (limited to 'src')
-rw-r--r-- | src/client.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/client.cpp b/src/client.cpp index 137210b1..75b24cc8 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -1162,7 +1162,7 @@ void Client::initUpdatesDir() } // Remove any trailing slash at the end of the update host - if (mUpdateHost.at(mUpdateHost.size() - 1) == '/') + if (!mUpdateHost.empty() && mUpdateHost.at(mUpdateHost.size() - 1) == '/') mUpdateHost.resize(mUpdateHost.size() - 1); // Parse out any "http://" or "ftp://", and set the updates directory @@ -1170,7 +1170,7 @@ void Client::initUpdatesDir() pos = mUpdateHost.find("://"); if (pos != mUpdateHost.npos) { - if (pos + 3 < mUpdateHost.length()) + if (pos + 3 < mUpdateHost.length() && !mUpdateHost.empty()) { updates << "updates/" << mUpdateHost.substr(pos + 3); mUpdatesDir = updates.str(); |