From: commit-bot@chromium.org Date: Wed, 9 Apr 2014 23:38:57 +0000 (+0000) Subject: Revert of remove sprintf (https://codereview.chromium.org/230413005/) X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~8336 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fe23f7978f4f75c6a9af025f26b583650342766e;p=platform%2Fupstream%2FlibSkiaSharp.git 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 #include -#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 @@ void* load_library(const char* appLocation, const char* libraryName) { // 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 #include -#ifdef SK_BUILD_FOR_WIN - #define snprintf _snprintf -#endif - namespace { void *CreateThreadError() { return SkNEW_ARGS(SkError, (kNoError_SkError)); @@ -133,7 +129,7 @@ void SkErrorInternals::SetError(SkError code, const char *fmt, ...) { 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);