diff options
author | Gihun Chang <gihun.chang@samsung.com> | 2016-12-15 13:56:51 +0900 |
---|---|---|
committer | Gihun Chang <gihun.chang@samsung.com> | 2016-12-16 09:05:55 +0900 |
commit | fd169d57e8bc1cb70fc8f9f03af64336eabd7d9e (patch) | |
tree | 0697bc439a202b114d4020813a96b805b7fadb6b | |
parent | e7ba29fd7c6ed4d618f395e517d76f9b89ad8f93 (diff) | |
download | ttrace-fd169d57e8bc1cb70fc8f9f03af64336eabd7d9e.tar.gz ttrace-fd169d57e8bc1cb70fc8f9f03af64336eabd7d9e.tar.bz2 ttrace-fd169d57e8bc1cb70fc8f9f03af64336eabd7d9e.zip |
Fix message overflowsubmit/tizen_3.0/20161216.045231
Change-Id: Iaa3a46b5d6550e02d3d5ea66d0213e44a2048779
-rw-r--r-- | src/TTraceWrapper.cpp | 5 | ||||
-rwxr-xr-x | src/ttrace.c | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/TTraceWrapper.cpp b/src/TTraceWrapper.cpp index c926095..7e535e4 100644 --- a/src/TTraceWrapper.cpp +++ b/src/TTraceWrapper.cpp @@ -23,11 +23,12 @@ TTraceWrapper::TTraceWrapper(uint64_t tags, const char* label, ...) { char fmtd_label[MAX_LEN]; tag = tags; + va_start(ap, label); vsnprintf(fmtd_label, MAX_LEN, label, ap); - - traceBegin(tag, fmtd_label); + traceBegin(tag, "%s", fmtd_label); va_end(ap); + } TTraceWrapper::~TTraceWrapper() { diff --git a/src/ttrace.c b/src/ttrace.c index a467583..c2573dc 100755 --- a/src/ttrace.c +++ b/src/ttrace.c @@ -155,7 +155,7 @@ void traceBegin(uint64_t tag, const char *name, ...) TTRACE_LOG("traceBegin:: write >> tag: %u tag_bit: %u", tag, *cur_enabled_tag); va_start(ap, name); - snprintf(buf, MAX_LEN, "B|%5d|", getpid()); + snprintf(buf, MAX_HEAD_LEN, "B|%5d|", getpid()); len += vsnprintf(buf + MAX_HEAD_LEN, POS_LABEL_ST, name, ap); va_end(ap); @@ -208,6 +208,7 @@ void traceAsyncBegin(uint64_t tag, int32_t cookie, const char *name, ...) va_list ap; TTRACE_LOG("traceAsyncBegin:: write >> tag: %u tag_bit: %u cookie: %d", tag, *cur_enabled_tag, cookie); + va_start(ap, name); snprintf(buf, MAX_LEN, "S|%5d|", getpid()); len += vsnprintf(buf + MAX_HEAD_LEN, POS_LABEL_ST, name, ap); |