continue using snprintf on POSIX systems
fix GCC warning: comparison between signed and unsigned integer expressions