CUtf8Utils::RFindValidUtf8Char: fix check of unsigned variable
authorKarlson2k <k2k@narod.ru>
Thu, 28 Nov 2013 15:04:05 +0000 (19:04 +0400)
committerKarlson2k <k2k@narod.ru>
Thu, 28 Nov 2013 15:04:05 +0000 (19:04 +0400)
xbmc/utils/Utf8Utils.cpp

index aa39108..cac02d4 100644 (file)
@@ -46,7 +46,7 @@ size_t CUtf8Utils::RFindValidUtf8Char(const std::string& str, const size_t start
 
   const char* strC = str.c_str();
   size_t pos = (startPos >= len) ? len - 1 : startPos;
-  while (pos >= 0)
+  while (pos < len)  // pos is unsigned, after zero pos becomes large then len
   {
     if (SizeOfUtf8Char(strC + pos))
       return pos;