Skip to content

Commit

Permalink
Fix code scanning alert #23: Incorrect return-value check for a 'scan…
Browse files Browse the repository at this point in the history
…f'-like function

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 358ab08 commit 477bb12
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/shared/dlt_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -3785,7 +3785,7 @@ void dlt_check_envvar()
if (env_log_level_str != NULL) {
int level = 0;

if (sscanf(env_log_level_str, "%d", &level))
if (sscanf(env_log_level_str, "%d", &level) == 1)
dlt_log_set_level(level);
}

Expand All @@ -3794,7 +3794,7 @@ void dlt_check_envvar()
if (env_log_mode != NULL) {
int mode = 0;

if (sscanf(env_log_mode, "%d", &mode))
if (sscanf(env_log_mode, "%d", &mode) == 1)
dlt_log_init(mode);
}

Expand Down

0 comments on commit 477bb12

Please sign in to comment.