fix some strncat vulnerabilities (#2648)
* fix some strncat vulnerabilities
* fix mingw build
* fix
* fix
* fix windows builds
* fix mingw
* fix
* use snprintf and avoid truncation
* forgot FsString
* fix mingw
* try to fix mingw
* fix windows
* fix mingw
* fix
* fix bug
* ready