--- a/corelib/UUIDGen.cpp
+++ b/corelib/UUIDGen.cpp
@@ -14,7 +14,7 @@
 
 #include "UUIDGen.h"
 #include "util.h" /* for trashMemory() */
-#include <stdio.h> /* for sprintf() */
+#include <stdio.h> /* for _stprintf() */
 #include <assert.h>
 
 #ifdef _WIN32
@@ -62,9 +62,9 @@
 void CUUIDGen::GetUUIDStr(uuid_str_t &str) const
 {
 #if _MSC_VER >= 1400
-  sprintf_s((char *)str, 36,
+  _stprintf_s((char *)str, 36,
 #else
-  sprintf((char *)str,
+  _stprintf((char *)str,
 #endif
 	  "%08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x",
 	  uuid.Data1, uuid.Data2, uuid.Data3,