some of the mess in here really bothers me (cherry-picking this commit of mine from next since it only fixes a small oversight with compiling and adds a comment)
snprintf is now available in MSVC 2015!