I suggest you use the `sprintf_s` on Windows, something like:

     #if _MSC_VER
     #define snprintf sprintf_s
     #end

Note: `sprintf_s` differs from `snprintf` in return value, but if you don't use it the trick above should be safe.
To be completely safe you need to create own `snprintf` implementation for Windows...