Skip to content

Commit

Permalink
Guest:fixed cppcheck failure
Browse files Browse the repository at this point in the history
Signed-off-by: Sudhakar Kuppusamy <[email protected]>
  • Loading branch information
SudhakarKuppusamy1 committed Oct 26, 2023
1 parent 3850de9 commit 210aaea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backends/guest/common/verify.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ int validate_variables_arguments(struct verify_args *args)
return ARG_PARSE_FAIL;
}

if ((args->update_variable_size != 0 && args->variable_path == NULL) ||
if ((args->update_variable_size && args->variable_path == NULL) ||
args->current_variable_size != 0) {
if (args->write_flag) {
prlog(PR_ERR,
Expand Down
4 changes: 2 additions & 2 deletions backends/guest/guest_svc_read.c
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ static int read_path(const char *path, const int is_print_raw, const char *varia
if (rc == SUCCESS) {
if (is_print_raw || esl_data_size == DEFAULT_PK_LEN)
print_raw((char *)esl_data, esl_data_size);
else if (esl_data_size != -1 && esl_data_size != 0) {
else if (esl_data_size >= TIMESTAMP_LEN) {
read_timestamp(esl_data);
rc = print_esl_buffer(esl_data + TIMESTAMP_LEN,
esl_data_size - TIMESTAMP_LEN, variable_name);
Expand All @@ -293,7 +293,7 @@ static int read_path(const char *path, const int is_print_raw, const char *varia
(esl_data_size == DEFAULT_PK_LEN &&
strcmp(defined_sb_variables[i], PK_VARIABLE) == 0))
print_raw((char *)esl_data, esl_data_size);
else if (esl_data_size != -1 && esl_data_size != 0) {
else if (esl_data_size >= TIMESTAMP_LEN) {
read_timestamp(esl_data);
rc = print_esl_buffer(esl_data + TIMESTAMP_LEN,
esl_data_size - TIMESTAMP_LEN,
Expand Down

0 comments on commit 210aaea

Please sign in to comment.