From 7cf8a24e73f57fcdf6974ae860ab01e38b40b100 Mon Sep 17 00:00:00 2001 From: Frank Herchet Date: Tue, 26 Jun 2012 14:03:16 +0200 Subject: * [GAM-55] fix wrong context id in logError and logInfo Signed-off-by: christian mueller --- AudioManagerDaemon/src/CAmDltWrapper.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/AudioManagerDaemon/src/CAmDltWrapper.cpp b/AudioManagerDaemon/src/CAmDltWrapper.cpp index 2d4fffe..aa7e423 100644 --- a/AudioManagerDaemon/src/CAmDltWrapper.cpp +++ b/AudioManagerDaemon/src/CAmDltWrapper.cpp @@ -83,13 +83,19 @@ void CAmDltWrapper::registerContext(DltContext& handle, const char *contextid, c dlt_register_context(&handle, contextid, description); #else (void) handle; - memcpy(&mDltContext.contextID,contextid,4); - const size_t str_len = strlen(description); - if(str_len < 2000) + + // store only the first contextID + if(0 == strlen(mDltContext.contextID)) { - mDltContextData.context_description = new char[str_len + 1]; - (void) strcpy(mDltContextData.context_description,description); + memcpy(&mDltContext.contextID,contextid,4); + const size_t str_len = strlen(description); + if(str_len < 2000) + { + mDltContextData.context_description = new char[str_len + 1]; + (void) strcpy(mDltContextData.context_description,description); + } } + #endif } -- cgit v1.2.1