behaviour of bytevector
Matthieu Riolo
matthieu.riolo at googlemail.com
Wed Apr 21 22:06:10 CEST 2010
String::String(const ByteVector &v, Type t)
{
d = new StringPrivate;
if(v.isEmpty())
return;
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);
}
If I see that correct is the check && (*it) a bit too much. Because
the input is a ByteVector it should be clear that the binary can
contain NULL values. But it should not matter as long we get the size
(and this one we always have). I guess it was copy&pasted from the
other constructors?
Regards, Matthieu Riolo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/taglib-devel/attachments/20100421/55113ec0/attachment.htm
More information about the taglib-devel
mailing list