[Scummvm-devel] zero bytes in Common::String

Max Horn max at quendi.de
Tue Jun 29 13:30:38 CEST 2010


Hi there,

I am probably to blame for the misleading zero-byte comment in the "String(char c)" constructor (and maybe elsewhere). The original goal was to work similar to std::string. However, it then was convenient to just wrap the C APIs, and well, here you go...

Is there any code that really needs to work with zero bytes in strings? If so, we could put in the effort to make this work (it's not *that* difficult to replace strlen, strcmp etc. anyway). 

But in general, I think it's easiest to simply drop the "zero bytes are allowed" thing and remove any comments or code which act differently. So unless somebody shouts loudly "I NEED ZERO BYTES IN STRINGS", we should do it this way.

Bye,
Max



More information about the Scummvm-devel mailing list