diff options
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/dlt_config_file_parser.c | 1 | ||||
-rw-r--r-- | src/shared/dlt_offline_trace.c | 3 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/shared/dlt_config_file_parser.c b/src/shared/dlt_config_file_parser.c index fc2d516..72c57ab 100644 --- a/src/shared/dlt_config_file_parser.c +++ b/src/shared/dlt_config_file_parser.c @@ -496,6 +496,7 @@ int dlt_config_file_get_section_name(const DltConfigFile *file, return -1; strncpy(name, (file->sections + num)->name, DLT_CONFIG_FILE_ENTRY_MAX_LEN); + name[DLT_CONFIG_FILE_ENTRY_MAX_LEN - 1] = '\0'; return 0; } diff --git a/src/shared/dlt_offline_trace.c b/src/shared/dlt_offline_trace.c index 2d70a77..2b1e0df 100644 --- a/src/shared/dlt_offline_trace.c +++ b/src/shared/dlt_offline_trace.c @@ -296,6 +296,9 @@ int dlt_offline_trace_delete_oldest_file(DltOfflineTrace *trace) /* go through all dlt files in directory */ DIR *dir = opendir(trace->directory); + if(!dir) + return -1; + while ((dp = readdir(dir)) != NULL) if (strstr(dp->d_name, DLT_OFFLINETRACE_FILENAME_BASE)) { int res = snprintf(filename, sizeof(filename), "%s/%s", trace->directory, dp->d_name); |