fix bug: last char in removeDVBChars was removed
authorFelix Domke <tmbinc@elitedvb.net>
Fri, 11 Nov 2005 03:30:49 +0000 (03:30 +0000)
committerFelix Domke <tmbinc@elitedvb.net>
Fri, 11 Nov 2005 03:30:49 +0000 (03:30 +0000)
lib/base/estring.cpp

index 22b6569..4259c58 100644 (file)
@@ -595,13 +595,13 @@ std::string removeDVBChars(const std::string &s)
        
        int len = s.length();
        
-       for(int i = 0; i < len-1; i++)
+       for(int i = 0; i < len; i++)
        {
                unsigned char c1 = s[i];
                unsigned int c;
                
                        /* UTF8? decode (but only simple) */
-               if(c1 > 0x80)
+               if((c1 > 0x80) && (i < len-1))
                {
                        unsigned char c2 = s[i + 1];
                        c = ((c1&0x3F)<<6) + (c2&0x3F);