ByteVector::data()

Andreas Hartmetz ahartmetz at gmail.com
Tue Sep 18 03:20:02 CEST 2007


Hi!

Today I dug around in taglib becaues Amarok crashed a lot. Turned out
to be an ancient taglib in /usr/local/lib...
Anyway, I think that QByteVector::data() (both const and non-const)
are extremely dangerous if size() == 0. Templated containers, for
example, may implicitly create empty instances. What about an
assert(size()) or returning a null pointer to make the error really
obvious? Some callers may even understand what a null char* pointer
means.

Cheers,
Andreas


More information about the taglib-devel mailing list