Index: src/core/SkError.cpp |
diff --git a/src/core/SkError.cpp b/src/core/SkError.cpp |
index 9e8ff2ddef01ff3fda1f5340f7a7e0f42713a796..2c4abc65c264e949691851b49877a8c53499fded 100644 |
--- a/src/core/SkError.cpp |
+++ b/src/core/SkError.cpp |
@@ -14,6 +14,10 @@ |
#include <stdio.h> |
#include <stdarg.h> |
+#ifdef SK_BUILD_FOR_WIN |
+ #define snprintf _snprintf |
+#endif |
+ |
namespace { |
void *CreateThreadError() { |
return SkNEW_ARGS(SkError, (kNoError_SkError)); |
@@ -129,7 +133,7 @@ void SkErrorInternals::SetError(SkError code, const char *fmt, ...) { |
break; |
} |
- sprintf( str, "%s: ", error_name ); |
+ snprintf(str, ERROR_STRING_LENGTH, "%s: ", error_name); |
int string_left = SkToInt(ERROR_STRING_LENGTH - strlen(str)); |
str += strlen(str); |