behaviour of bytevector

Matthieu Riolo matthieu.riolo at
Wed Apr 21 22:06:10 CEST 2010

String::String(const ByteVector &v, Type t)
   d = new StringPrivate;


   if(t == Latin1 || t == UTF8) {

     int length = 0;
     wstring::iterator targetIt = d->data.begin();
     for(ByteVector::ConstIterator it = v.begin(); it != v.end() &&  
(*it); ++it) {
       *targetIt = uchar(*it);

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...

More information about the taglib-devel mailing list