Added #ifdef _WIN32 for snprintf