From 90c8b5b2890a227088b5a67a21bdc24028b156d5 Mon Sep 17 00:00:00 2001 From: Phong Tran Date: Thu, 29 Mar 2018 13:51:29 +0700 Subject: minor compiler warning gcc 7.x (#30) * Fix -Wpointer-compare of compare with null char Signed-off-by: Phong Tran * dlt_common: fix -Wformat-truncation of snprintf Avoid snprintf output truncation by handling return value Signed-off-by: Phong Tran * 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 * 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 --- src/daemon/dlt_daemon_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/daemon/dlt_daemon_common.c') diff --git a/src/daemon/dlt_daemon_common.c b/src/daemon/dlt_daemon_common.c index 096708c..11be6e6 100644 --- a/src/daemon/dlt_daemon_common.c +++ b/src/daemon/dlt_daemon_common.c @@ -596,7 +596,7 @@ int dlt_daemon_applications_save(DltDaemon *daemon, const char *filename, int ve dlt_set_id(apid,daemon->applications[i].apid); if ((daemon->applications[i].application_description) && - (daemon->applications[i].application_description!='\0')) + (daemon->applications[i].application_description[0] != '\0')) { fprintf(fd,"%s:%s:\n",apid, daemon->applications[i].application_description); } -- cgit v1.2.1