va_list variable will be invalid after the first call. Use va_copy to
initialize the va_list for another call.
BUG=skia:
R=djsollen@google.com, mtklein@google.com
Author: qiankun.miao@intel.com
Review URL: https://codereview.chromium.org/
394763004
}
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);
}