Skip to content

Commit

Permalink
fixup! config_update.c: (mostly) fix mix of size_t and int that lead …
Browse files Browse the repository at this point in the history
…to compiler warnings

TODO check in function CONF_update_config: file_len is always 0
  • Loading branch information
kiron-mx committed Jan 29, 2024
1 parent af60fb6 commit 1c2b3b3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/config/config_update.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static size_t refactor_entry(char *src_p, char *dest_p, const char *const key_p,
pos_p--;
}
if(pos_p < pos_start || (size_t)(pos_p - pos_start) != val_len
|| strncmp(pos_start, val_p, val_len))
|| strncmp(pos_start, val_p, val_len) not_eq 0)
{
file_modified = 1;
}
Expand Down Expand Up @@ -183,7 +183,7 @@ static size_t read_config_until_section(FILE* file_p, const char* file_name, con
LOG(FL_ERR, "Cannot find section '%s' in config file '%s'", section_name, file_name);
return 0;
}
return file_len;
return file_len; /* TODO check: file_len is always 0 */
}


Expand All @@ -209,7 +209,7 @@ static size_t add_to_config_section(size_t file_len, const key_val_section* cons
}
}

return file_len;
return file_len; /* TODO check: file_len is not updated */
}


Expand Down Expand Up @@ -297,11 +297,12 @@ static size_t copy_remaining_config(FILE *file_p, size_t file_len,
line_len = strnlen(input_line, c_line_buf_size);
copy_file_line(file_buffer, input_line, line_len);
}
return file_len;
return file_len; /* TODO check: file_len is not updated */
}


/* returns length of new file, or 0 in case of error */
/* TODO check: return value is always 0 */
int CONF_update_config(OPTIONAL ossl_unused uta_ctx* ctx, const char* file_name, const key_val_section* key_val_section,
int exclude)
{
Expand Down Expand Up @@ -391,7 +392,7 @@ int CONF_update_config(OPTIONAL ossl_unused uta_ctx* ctx, const char* file_name,
return 0;
}
#endif
return (int)file_len;
return (int)file_len; /* TODO check: file_len is always 0 */
}
else
{
Expand Down

0 comments on commit 1c2b3b3

Please sign in to comment.