summaryrefslogtreecommitdiff
path: root/src/lib/dlt_user.c
diff options
context:
space:
mode:
authorPhong Tran <tranmanphong@gmail.com>2018-03-29 13:51:29 +0700
committerManikandanChockalingam <manikandan.chockalingam@in.bosch.com>2018-03-29 12:21:29 +0530
commit90c8b5b2890a227088b5a67a21bdc24028b156d5 (patch)
treeeb8fea77da9090e94ada870fa8519ce479e18e58 /src/lib/dlt_user.c
parentb3b7f98bff66d8235474f68004f7b767835b8e3e (diff)
downloadDLT-daemon-90c8b5b2890a227088b5a67a21bdc24028b156d5.tar.gz
minor compiler warning gcc 7.x (#30)
* Fix -Wpointer-compare of compare with null char Signed-off-by: Phong Tran <tranmanphong@gmail.com> * dlt_common: fix -Wformat-truncation of snprintf Avoid snprintf output truncation by handling return value Signed-off-by: Phong Tran <tranmanphong@gmail.com> * dlt_offline_trace: Fix Wformat-truncation of snprintf Compile with Gcc 7.x has the warning of snprintf buffer length size. Check return value of snprintf() for avoiding the warning. Signed-off-by: Phong Tran <tranmanphong@gmail.com> * dlt_common_test: Fix memleak t_dlt_message_read some resources were not free after using. Detected by running valgrind --leak-check=full ./gtest_dlt_common Signed-off-by: Phong Tran <tranmanphong@gmail.com>
Diffstat (limited to 'src/lib/dlt_user.c')
-rw-r--r--src/lib/dlt_user.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/dlt_user.c b/src/lib/dlt_user.c
index eba6189..8d1aec1 100644
--- a/src/lib/dlt_user.c
+++ b/src/lib/dlt_user.c
@@ -3817,7 +3817,7 @@ DltReturnValue dlt_user_log_send_register_context(DltContextData *log)
return DLT_RETURN_ERROR;
}
- if (log->handle->contextID=='\0')
+ if (log->handle->contextID[0] == '\0')
{
return DLT_RETURN_ERROR;
}
@@ -3900,7 +3900,7 @@ DltReturnValue dlt_user_log_send_unregister_context(DltContextData *log)
return DLT_RETURN_WRONG_PARAMETER;
}
- if (log->handle->contextID=='\0')
+ if (log->handle->contextID[0] == '\0')
{
return DLT_RETURN_ERROR;
}