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:
Scott Wheeler 2004-05-06 12:36:31 +00:00
parent ceb989f170
commit 6a2cdbcc45

View File

@ -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);