Index: src/ports/SkDebug_android.cpp |
diff --git a/src/ports/SkDebug_android.cpp b/src/ports/SkDebug_android.cpp |
index 70029fbb6db965169e10a41db994d9175fa72bc4..b41abd309110bba5a0600344828548d0a2d6e97b 100644 |
--- a/src/ports/SkDebug_android.cpp |
+++ b/src/ports/SkDebug_android.cpp |
@@ -22,15 +22,17 @@ extern "C" void AndroidSkDebugToStdOut(bool debugToStdOut) { |
} |
void SkDebugf(const char format[], ...) { |
- va_list args; |
- va_start(args, format); |
- __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args); |
+ va_list args1, args2; |
+ va_start(args1, format); |
+ va_copy(args2, args1); |
+ __android_log_vprint(ANDROID_LOG_DEBUG, LOG_TAG, format, args1); |
// Print debug output to stdout as well. This is useful for command |
// line applications (e.g. skia_launcher) |
if (gSkDebugToStdOut) { |
- vprintf(format, args); |
+ vprintf(format, args2); |
} |
- va_end(args); |
+ va_end(args1); |
+ va_end(args2); |
} |