Improved snprintf for windows