aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmarshallnz <jcmarsha@gmail.com>2014-03-08 09:50:54 +1300
committerjmarshallnz <jcmarsha@gmail.com>2014-03-08 09:50:54 +1300
commit5c906c32e3ae410f0ce3c2825bf60a4d3018828b (patch)
tree55d07b3499ee1271ba2bcba40388a27655a1fa8e
parent9508ed3611da86138396b53999894300d5d7e988 (diff)
parentca3ffb176052b1e233d7d6f54f3c02d1dbb4da4c (diff)
Merge pull request #4366 from Montellese/uriutils_resolvepath_fix
URIUtils: fix out of range exception in resolvePath()
-rw-r--r--xbmc/utils/URIUtils.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/xbmc/utils/URIUtils.cpp b/xbmc/utils/URIUtils.cpp
index ea4ff97371..12dadbadac 100644
--- a/xbmc/utils/URIUtils.cpp
+++ b/xbmc/utils/URIUtils.cpp
@@ -1226,10 +1226,12 @@ std::string URIUtils::resolvePath(const std::string &path)
CStdString realPath;
int i = 0;
// re-add any / or \ at the beginning
- while (path.at(i) == delim.at(0))
+ for (std::string::const_iterator itPath = path.begin(); itPath != path.end(); ++itPath)
{
+ if (*itPath != delim.at(0))
+ break;
+
realPath += delim;
- i++;
}
// put together the path
realPath += StringUtils::Join(realParts, delim);