Friday, June 20, 2008

wxWidget bug

I found a weird bug in wxString::Format function, if i were to substitude > 64 variables into the string, all the other substitutions will not work and be converted into the letter of their substitution type, example:

char c = 'i';
wxString::Format("%c %c %c <... repeat 61 more times> %c %c", c, c, c, <... repeat 61 more times> c, c);

the output of the above string will be "i i i i <... repeat 60 more times> c c" where the c represents the %c used in the string, and they are not converted to the variable c even though the string is perfectly valid and the c is being assigned.

wxString::Format function is an inline function that basically uses the printf function, I don't know if that's the maximum insertion any printf function can handle or is it just wxString::Format function made a limit to itself. probabaly should test them out

No comments: