Closed thetrime closed 2 years ago
Thanks! I see this is an old PR that was somehow missed!? It sill seems relevant. I'll check. Unfortunately it needs merging by hand.
Went though the patches, I see there is no issue as long as we trust wsprintf() not to write more characters than its maxlen as the 0 is always written after the maxlen. I can't find this branch anymore. Not sure what happened. Closing.
…a character other than NULL to the last byte of the buffer. We need to set this explicitly after calling swprintf() and before trying to use the value. Technically we only have to set it if swprintf() returns a value < 0 but in practise it is not unsafe to do it in both cases and the code is less cluttered