summaryrefslogtreecommitdiff
path: root/src/shared/dlt_common.c
diff options
context:
space:
mode:
authorRadoslaw Kaczorowski <external.radoslaw.kaczorowski@bosch-softtec.com>2019-06-17 11:19:22 +0700
committerSaya Sugiura <39760799+ssugiura@users.noreply.github.com>2019-07-03 11:48:10 +0900
commit646f76c58bc81b2d41163b2e9dfcf279ebd9e887 (patch)
tree81f1f4d9532e28ec006e71c268c739fd71e13828 /src/shared/dlt_common.c
parentb757183f51920e8445ed0ea0bbdb490d99781ec6 (diff)
downloadDLT-daemon-646f76c58bc81b2d41163b2e9dfcf279ebd9e887.tar.gz
define DLT_PATH_MAX for max path buffer length
DLT limits the path length and does not do anything else to determine the actual value, because the least that is supported on any system that DLT runs on is 1024 bytes. Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
Diffstat (limited to 'src/shared/dlt_common.c')
-rw-r--r--src/shared/dlt_common.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/dlt_common.c b/src/shared/dlt_common.c
index 4d6fcee..8f5bc76 100644
--- a/src/shared/dlt_common.c
+++ b/src/shared/dlt_common.c
@@ -67,7 +67,7 @@
const char dltSerialHeader[DLT_ID_SIZE] = { 'D', 'L', 'S', 1 };
char dltSerialHeaderChar[DLT_ID_SIZE] = { 'D', 'L', 'S', 1 };
-char dltFifoBaseDir[PATH_MAX + 1] = "/tmp";
+char dltFifoBaseDir[DLT_PATH_MAX] = "/tmp";
/* internal logging parameters */
static int logging_mode = DLT_LOG_TO_CONSOLE;
@@ -1701,8 +1701,8 @@ void dlt_log_set_filename(const char *filename)
void dlt_log_set_fifo_basedir(const char *env_pipe_dir)
{
- strncpy(dltFifoBaseDir, env_pipe_dir, PATH_MAX);
- dltFifoBaseDir[PATH_MAX] = 0;
+ strncpy(dltFifoBaseDir, env_pipe_dir, DLT_PATH_MAX);
+ dltFifoBaseDir[DLT_PATH_MAX - 1] = 0;
}
void dlt_log_init(int mode)
@@ -2495,7 +2495,7 @@ int dlt_buffer_push3(DltBuffer *buf,
}
/* set header */
- strncpy(head.head, DLT_BUFFER_HEAD, 3);
+ strncpy(head.head, DLT_BUFFER_HEAD, 4);
head.head[3] = 0;
head.status = 2;
head.size = size1 + size2 + size3;