From a7c0e05d738abfa6b6edfa3222224aed74d1af6e Mon Sep 17 00:00:00 2001 From: Gihun Chang Date: Fri, 16 Dec 2016 17:18:26 +0900 Subject: Fix side effect on previous commit Change-Id: Ice3dd142bb38b15fa331157d2b6b0ef9dd106b8e --- src/TTraceWrapper.cpp | 2 +- src/ttrace.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TTraceWrapper.cpp b/src/TTraceWrapper.cpp index 7e535e4..9528fd4 100644 --- a/src/TTraceWrapper.cpp +++ b/src/TTraceWrapper.cpp @@ -25,7 +25,7 @@ TTraceWrapper::TTraceWrapper(uint64_t tags, const char* label, ...) { tag = tags; va_start(ap, label); - vsnprintf(fmtd_label, MAX_LEN, label, ap); + vsnprintf(fmtd_label, MAX_LEN-8, label, ap); traceBegin(tag, "%s", fmtd_label); va_end(ap); diff --git a/src/ttrace.c b/src/ttrace.c index c2573dc..89e8509 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_HEAD_LEN, "B|%5d|", getpid()); + snprintf(buf, MAX_LEN, "B|%5d|", getpid()); len += vsnprintf(buf + MAX_HEAD_LEN, POS_LABEL_ST, name, ap); va_end(ap); -- cgit v1.2.3