mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
A small regression -- when assigning a ByteVector to a String make sure to
not include the trailing null characters. (This was introduced after the last release.) git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@309070 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
parent
ceb989f170
commit
6a2cdbcc45
@ -160,12 +160,15 @@ String::String(const ByteVector &v, Type t)
|
||||
|
||||
if(t == Latin1 || t == UTF8) {
|
||||
|
||||
int length = 0;
|
||||
d->data.resize(v.size());
|
||||
wstring::iterator targetIt = d->data.begin();
|
||||
for(ByteVector::ConstIterator it = v.begin(); it != v.end() && (*it); ++it) {
|
||||
*targetIt = uchar(*it);
|
||||
++targetIt;
|
||||
++length;
|
||||
}
|
||||
d->data.resize(length);
|
||||
}
|
||||
else {
|
||||
d->data.resize(v.size() / 2);
|
||||
|
Loading…
Reference in New Issue
Block a user