From: Scott Wheeler Date: Mon, 11 Feb 2008 22:49:59 +0000 (+0000) Subject: fix one of the checks, don't cast this to a value over 255 X-Git-Tag: v1.5~18 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ddaf3cc47916c6d43397dfa2cf4dc5a3f2c806c0;p=taglib fix one of the checks, don't cast this to a value over 255 git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@773877 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- diff --git a/taglib/toolkit/tbytevector.cpp b/taglib/toolkit/tbytevector.cpp index 4a51fed8..e180e908 100644 --- a/taglib/toolkit/tbytevector.cpp +++ b/taglib/toolkit/tbytevector.cpp @@ -116,7 +116,7 @@ namespace TagLib { lastOccurrence[i] = uchar(pattern.size()); for(uint i = 0; i < pattern.size() - 1; ++i) - lastOccurrence[unsigned(pattern[i])] = uchar(pattern.size() - i - 1); + lastOccurrence[uchar(pattern[i])] = uchar(pattern.size() - i - 1); for(uint i = pattern.size() - 1 + offset; i < v.size(); i += lastOccurrence[uchar(v.at(i))]) { int iBuffer = i; @@ -430,8 +430,8 @@ ByteVector &ByteVector::replace(const ByteVector &pattern, const ByteVector &wit int offset = find(pattern); - while(offset >= 0) - { + while(offset >= 0) { + const int originalSize = size(); if(withSize > patternSize)