Revert of remove sprintf (https://codereview.chromium.org/230413005/)
Reason for revert:
Boo, hiss, SK_ARRAY_COUNT not defined in skia_launcher.cpp!
Original issue's description:
> remove sprintf
>
> Committed: http://code.google.com/p/skia/source/detail?r=14123
R=halcanary@google.com
TBR=halcanary@google.com
NOTREECHECKS=true
NOTRY=true
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/232323002
git-svn-id: http://skia.googlecode.com/svn/trunk@14125 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/platform_tools/android/launcher/skia_launcher.cpp b/platform_tools/android/launcher/skia_launcher.cpp
index d1bdcb5..746d470 100644
--- a/platform_tools/android/launcher/skia_launcher.cpp
+++ b/platform_tools/android/launcher/skia_launcher.cpp
@@ -8,10 +8,6 @@
#include <dlfcn.h>
#include <stdio.h>
-#ifdef SK_BUILD_FOR_WIN
- #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");
@@ -36,8 +32,7 @@
{
// attempt to lookup the location of the shared libraries
char libraryLocation[100];
- snprintf(libraryLocation, SK_ARRAY_COUNT(libraryLocation),
- "%s/lib%s.so", appLocation, libraryName);
+ sprintf(libraryLocation, "%s/lib%s.so", appLocation, libraryName);
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");
diff --git a/src/core/SkError.cpp b/src/core/SkError.cpp
index 2c4abc6..9e8ff2d 100644
--- a/src/core/SkError.cpp
+++ b/src/core/SkError.cpp
@@ -14,10 +14,6 @@
#include <stdio.h>
#include <stdarg.h>
-#ifdef SK_BUILD_FOR_WIN
- #define snprintf _snprintf
-#endif
-
namespace {
void *CreateThreadError() {
return SkNEW_ARGS(SkError, (kNoError_SkError));
@@ -133,7 +129,7 @@
break;
}
- snprintf(str, ERROR_STRING_LENGTH, "%s: ", error_name);
+ sprintf( str, "%s: ", error_name );
int string_left = SkToInt(ERROR_STRING_LENGTH - strlen(str));
str += strlen(str);