Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Unified Diff: src/core/SkError.cpp

Issue 230413005: remove sprintf (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: AnotherPatchSet Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « platform_tools/android/launcher/skia_launcher.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « platform_tools/android/launcher/skia_launcher.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698