diff options
author | Saya Sugiura <ssugiura@jp.adit-jv.com> | 2019-06-07 17:02:18 +0900 |
---|---|---|
committer | Saya Sugiura <39760799+ssugiura@users.noreply.github.com> | 2019-07-24 07:53:41 +0900 |
commit | c32b3a39e484c1fc5ff625c752c6beeb9426ff85 (patch) | |
tree | e5cdb0088d8e988d6079e83dd2b7f2206e4bdb07 /src/shared | |
parent | 5c8f88d1225897ac8613ad3d4ca26c861dcc299b (diff) | |
download | DLT-daemon-c32b3a39e484c1fc5ff625c752c6beeb9426ff85.tar.gz |
Correct sa findings
dlt_offline_logstorage.c
- Parameter to isdigit is not correct
- Handle the size of memset() and strncpy() properly
dlt-test-stress-user.c
- Parameter d is duplicated
dlt_env_ll.c
- Parameter env is used before NULL check
- Remove redundant line
dlt-control-common.c
dlt_daemon_event_handler.c
- Do not use NULL variable to print log
dlt_config_file_parser.c
- Remove unnecessary loop
dlt_daemon_client.c
- Return error in NULL check
dlt_user.c
- Free allocated memory in error case
Related commit: 5c8f88d logstorage: fix compile error
Signed-off-by: Saya Sugiura <ssugiura@jp.adit-jv.com>
Diffstat (limited to 'src/shared')
-rw-r--r-- | src/shared/dlt_config_file_parser.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/shared/dlt_config_file_parser.c b/src/shared/dlt_config_file_parser.c index 329e0ad..bf6dfb4 100644 --- a/src/shared/dlt_config_file_parser.c +++ b/src/shared/dlt_config_file_parser.c @@ -76,18 +76,11 @@ static void dlt_config_file_trim_line(char *line) */ static int dlt_config_file_ignore_line(char *line) { - int i = 0; - int len = strlen(line); - - for (i = 0; i < len; i++) { - if ((line[i] == '#') || (line[i] == ';') || (line[i] == '\n') || (line[i] == '\0')) - return 0; /* ignore */ - else - return -1; /* do not ignore */ - - } - - return -1; + if ((line[0] == '#') || (line[0] == ';') || (line[0] == '\n') || + (line[0] == '\0')) + return 0; /* ignore */ + else + return -1; /* do not ignore */ } /** |