mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Fixed behavior change of ByteVector::containsAt()
This commit is contained in:
parent
df5bf232eb
commit
860a605c8d
@ -601,11 +601,11 @@ bool ByteVector::containsAt(const ByteVector &pattern, uint offset, uint pattern
|
||||
patternLength = pattern.size();
|
||||
|
||||
// do some sanity checking -- all of these things are needed for the search to be valid
|
||||
|
||||
if(offset + patternLength > size() || patternOffset >= pattern.size() || patternLength == 0)
|
||||
const uint compareLength = patternLength - patternOffset;
|
||||
if(offset + compareLength > size() || patternOffset >= pattern.size() || patternLength == 0)
|
||||
return false;
|
||||
|
||||
return (::memcmp(data() + offset, pattern.data() + patternOffset, patternLength - patternOffset) == 0);
|
||||
return (::memcmp(data() + offset, pattern.data() + patternOffset, compareLength) == 0);
|
||||
}
|
||||
|
||||
bool ByteVector::startsWith(const ByteVector &pattern) const
|
||||
|
Loading…
Reference in New Issue
Block a user