summaryrefslogtreecommitdiff
path: root/src/offlinelogstorage/dlt_offline_logstorage.c
diff options
context:
space:
mode:
authorRadoslaw Kaczorowski <external.radoslaw.kaczorowski@bosch-softtec.com>2019-06-24 13:51:06 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2019-07-03 11:48:10 +0900
commit038da647b999c9f5183e8459e5d39b9450c1d078 (patch)
tree8974e354ed0e459223262a06f0e6d5cbb121ae71 /src/offlinelogstorage/dlt_offline_logstorage.c
parent646f76c58bc81b2d41163b2e9dfcf279ebd9e887 (diff)
downloadDLT-daemon-038da647b999c9f5183e8459e5d39b9450c1d078.tar.gz
fix config path for dlt-dbus
use default config path relative to CONFIGURATION_FILES_DIR Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
Diffstat (limited to 'src/offlinelogstorage/dlt_offline_logstorage.c')
-rw-r--r--src/offlinelogstorage/dlt_offline_logstorage.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/offlinelogstorage/dlt_offline_logstorage.c b/src/offlinelogstorage/dlt_offline_logstorage.c
index fe1af71..0eda630 100644
--- a/src/offlinelogstorage/dlt_offline_logstorage.c
+++ b/src/offlinelogstorage/dlt_offline_logstorage.c
@@ -357,7 +357,7 @@ DLT_STATIC int dlt_logstorage_read_list_of_names(char **names, char *value)
strncpy((*names + y), tok, len);
if ((num > 1) && (i < num))
- strncpy((*names + y + len), ",", 1);
+ strncpy((*names + y + len), ",", 2);
y += len + 1;
@@ -1554,7 +1554,7 @@ DLT_STATIC int dlt_logstorage_store_filters(DltLogStorage *handle,
*/
DLT_STATIC int dlt_logstorage_load_config(DltLogStorage *handle)
{
- char config_file_name[PATH_MAX + 1] = { '\0' };
+ char config_file_name[PATH_MAX] = {0};
int ret = 0;
/* Check if handle is NULL or already initialized or already configured */
@@ -1579,7 +1579,7 @@ DLT_STATIC int dlt_logstorage_load_config(DltLogStorage *handle)
"Creating configuration file path string failed\n");
return -1;
}
-
+ config_file_name[PATH_MAX - 1] = 0;
ret = dlt_logstorage_store_filters(handle, config_file_name);
if (ret == 1) {
@@ -1624,6 +1624,7 @@ int dlt_logstorage_device_connected(DltLogStorage *handle, char *mount_point)
}
strncpy(handle->device_mount_point, mount_point, DLT_MOUNT_PATH_MAX);
+ handle->device_mount_point[DLT_MOUNT_PATH_MAX] = 0;
handle->connection_type = DLT_OFFLINE_LOGSTORAGE_DEVICE_CONNECTED;
handle->config_status = 0;
handle->write_errors = 0;
@@ -1653,7 +1654,7 @@ int dlt_logstorage_device_disconnected(DltLogStorage *handle, int reason)
dlt_logstorage_free(handle, reason);
/* Reset all device status */
- memset(handle->device_mount_point, '\0', sizeof(char) * DLT_MOUNT_PATH_MAX);
+ memset(handle->device_mount_point, 0, sizeof(char) * (DLT_MOUNT_PATH_MAX + 1));
handle->connection_type = DLT_OFFLINE_LOGSTORAGE_DEVICE_DISCONNECTED;
handle->config_status = 0;
handle->write_errors = 0;