summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Onorato <joeo@google.com>2016-12-20 08:21:38 -0800
committerJoe Onorato <joeo@google.com>2016-12-20 22:28:56 -0800
commit5a991adaf5a362761b2600af34989f38fbfc74ec (patch)
treefbc76a313b17ca32fc398d572afb6491531a0f8f
parent7669012623a18855913c84ec0690066fbfd823ea (diff)
Fix varargs bug that made incident_report print incorrectly.
Test: incident_report 3000 Change-Id: I397677ecd6e50ad143518416c8fa3e408139189b
-rw-r--r--tools/incident_report/printer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/incident_report/printer.cpp b/tools/incident_report/printer.cpp
index 8111b2786007..bd660dd20dfd 100644
--- a/tools/incident_report/printer.cpp
+++ b/tools/incident_report/printer.cpp
@@ -69,8 +69,10 @@ Out::printf(const char* format, ...)
va_start(args, format);
len = vsnprintf(mBuf, mBufSize, format, args);
+ va_end(args);
bool truncated = (len >= mBufSize) && (reallocate(len) < len);
-
+
+ va_start(args, format);
len = vsnprintf(mBuf, mBufSize, format, args);
va_end(args);