So I guess you don't support Linux?

For MSVC, your _snprintf_s syntax looks wrong. 3rd arg should be _TRUNCATE. This actually compiled?

Not that this is the solution to all your problems, but...