From 103360ffe5ab1333883d6eb1e2c853789015037c Mon Sep 17 00:00:00 2001 From: Youngwan Kim Date: Wed, 11 Jul 2018 21:11:47 +0900 Subject: [PATCH] [COMMON] lib: dss: fix bug setting 0 at wrong position in acpm log Change-Id: I1c7adcca4a35f28083f8897cc67149b397ee63a9 Signed-off-by: Youngwan Kim --- lib/debug-snapshot-log.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/debug-snapshot-log.c b/lib/debug-snapshot-log.c index e961633a4c3b..f0de5bf459ba 100644 --- a/lib/debug-snapshot-log.c +++ b/lib/debug-snapshot-log.c @@ -1299,13 +1299,13 @@ void dbg_snapshot_acpm(unsigned long long timestamp, const char *log, unsigned i (ARRAY_SIZE(dss_log->acpm) - 1); int len = strlen(log); - if (len >= 9) - len = 9; + if (len >= 8) + len = 8; dss_log->acpm[i].time = cpu_clock(cpu); dss_log->acpm[i].acpm_time = timestamp; strncpy(dss_log->acpm[i].log, log, len); - dss_log->acpm[i].log[8] = '\0'; + dss_log->acpm[i].log[len] = '\0'; dss_log->acpm[i].data = data; } } -- 2.20.1