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

Unified Diff: platform_tools/android/launcher/skia_launcher.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 | « no previous file | src/core/SkError.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: platform_tools/android/launcher/skia_launcher.cpp
diff --git a/platform_tools/android/launcher/skia_launcher.cpp b/platform_tools/android/launcher/skia_launcher.cpp
index 746d470a3c2dcaad8d38bc0b1671d75daddc0e62..7f06f708cb6111ddad49d131e62c881fc2874de0 100644
--- a/platform_tools/android/launcher/skia_launcher.cpp
+++ b/platform_tools/android/launcher/skia_launcher.cpp
@@ -8,6 +8,12 @@
#include <dlfcn.h>
#include <stdio.h>
+#ifdef SK_BUILD_FOR_WIN
+ #define SNPRINTF _snprintf
mtklein 2014/04/09 20:49:40 Or just, #define snprintf _snprintf, with no else?
hal.canary 2014/04/09 21:38:50 Done.
+#else
+ #define SNPRINTF snprintf
+#endif
+
void usage() {
printf("[USAGE] skia_launcher program_name [options]\n");
printf(" program_name: the skia program you want to launch (e.g. tests, bench)\n");
@@ -32,7 +38,7 @@ void* load_library(const char* appLocation, const char* libraryName)
{
// attempt to lookup the location of the shared libraries
char libraryLocation[100];
- sprintf(libraryLocation, "%s/lib%s.so", appLocation, libraryName);
+ SNPRINTF(libraryLocation, 100, "%s/lib%s.so", appLocation, libraryName);
mtklein 2014/04/09 20:49:40 SK_ARRAY_COUNT(libraryLocation) instead of 100?
hal.canary 2014/04/09 21:38:50 Done.
if (!file_exists(libraryLocation)) {
printf("ERROR: Unable to find the '%s' library in the Skia App.\n", libraryName);
printf("ERROR: Did you provide the correct program_name?\n");
« no previous file with comments | « no previous file | src/core/SkError.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698