Summary:
swprintf has different signatures in mingw32, where it does not include the
buffer size, and in mingw-w64, where it does. That of course breaks the code
as mingw-w64 treats the pointer to the format string as a size_t.

snwprintf is available in both environments and is consistent, so use that
instead.