On 4/17/06, Tomas Carnecky tom@dbservice.com wrote:
Wine doesn't crash in this function, sorry, it's a bug in pf_vsnprintf() which causes snprintf() to write beyond the end of the buffer.
I've attached a patch that fixes it for me, but it's probably better not to create such large buffers on the stack. Anyone with a better fix?
tom
Basically your making number big enough to hold the output. You don't need to keep track of the max size. If it got truncated, it would be wrong anyway and the program may crash in a less obvious way. I'd say do this: Find out the minimum required size for number to make WoW not crash, and round up to the nearest 10's. Like your test required 91, make number 100. Hopefully we only need to do this once, and looking at the code, I'm sure that windows has a limitation like this somewhere too.
Jesse