diff options
author | Vo Trung Chi <Chi.VoTrung@vn.bosch.com> | 2019-05-06 17:31:15 +0700 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2019-09-13 08:49:53 +0900 |
commit | ee7943c0fd408739b0c6313c679c3c9a2c3a23a0 (patch) | |
tree | a2fb6f34b8158a1800639344c51640a922e09c2a /src | |
parent | a3be75bc16e84b37ba9fbe9b6795262ebb32e63c (diff) | |
download | DLT-daemon-ee7943c0fd408739b0c6313c679c3c9a2c3a23a0.tar.gz |
parser: Change maximum number of config section
This commit includes improvement of related code.
Signed-off-by: Vo Trung Chi <Chi.VoTrung@vn.bosch.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/dlt_config_file_parser.c | 4 | ||||
-rw-r--r-- | src/shared/dlt_config_file_parser.h | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/shared/dlt_config_file_parser.c b/src/shared/dlt_config_file_parser.c index bf6dfb4..e701341 100644 --- a/src/shared/dlt_config_file_parser.c +++ b/src/shared/dlt_config_file_parser.c @@ -123,7 +123,7 @@ static int dlt_config_file_set_section(DltConfigFile *file, char *name) int section = file->num_sections; /* check if adding another section would exceed max number of sections */ - if (section + 1 >= DLT_CONFIG_FILE_SECTIONS_MAX) { + if (section >= DLT_CONFIG_FILE_SECTIONS_MAX) { dlt_log(LOG_WARNING, "Cannot store more sections\n"); return -1; /* reached max number of sections */ } @@ -538,6 +538,6 @@ int dlt_config_file_get_value(const DltConfigFile *file, } } - dlt_log(LOG_WARNING, "Entry does not exist in section \n"); + dlt_vlog(LOG_WARNING, "Entry does not exist in section: %s\n", key); return -1; } diff --git a/src/shared/dlt_config_file_parser.h b/src/shared/dlt_config_file_parser.h index 915ddc0..acde08c 100644 --- a/src/shared/dlt_config_file_parser.h +++ b/src/shared/dlt_config_file_parser.h @@ -62,7 +62,7 @@ #define DLT_CONFIG_FILE_PATH_MAX_LEN 100 /* absolute path including filename */ #define DLT_CONFIG_FILE_ENTRY_MAX_LEN 100 /* Entry for section, key and value */ #define DLT_CONFIG_FILE_LINE_MAX_LEN 210 -#define DLT_CONFIG_FILE_SECTIONS_MAX 100 +#define DLT_CONFIG_FILE_SECTIONS_MAX 125 #define DLT_CONFIG_FILE_KEYS_MAX 25 /* Maximal keys per section */ typedef struct DltConfigKeyData |