This makes it more compatible with the standard behaviour of vswprintf() and allows to use the same logic in the builds using our version of this function and the normal ones in DoStringPrintfV(), simplifying its (already rather hairy) logic. Update the tests to not require any particular return value in case of buffer overflow, as this differs between Unicode and non-Unicode builds. When we finally drop the latter, we should just check that it always returns -1 in this case. Note that ideal would be to return the actually needed size of the buffer in case of the error due to buffer being too small, but this isn't that simple to do and it's probably not worth spending time on improving this code as long as we still need to use the buffer doubling strategy in DoStringPrintfV() when using the standard vswprintf().
18 KiB
18 KiB