[tidy] fixing some uninit issues

This commit is contained in:
Tim Stack 2022-09-21 21:06:04 -07:00
parent 93a53c4224
commit 7f513b2d1f
3 changed files with 11 additions and 9 deletions

View File

@ -200,6 +200,9 @@ line_buffer::gz_indexed::open(int fd, header_data& hd)
unsigned char name[1024];
unsigned char comment[4096];
name[0] = '\0';
comment[0] = '\0';
gz_header gz_hd;
memset(&gz_hd, 0, sizeof(gz_hd));
gz_hd.name = name;

View File

@ -90,23 +90,23 @@ public:
logline(file_off_t off,
time_t t,
uint16_t millis,
log_level_t l,
log_level_t lev,
uint8_t mod = 0,
uint8_t opid = 0)
: ll_offset(off), ll_time(t), ll_millis(millis), ll_opid(opid),
ll_sub_offset(0), ll_valid_utf(1), ll_level(l), ll_module_id(mod),
ll_expr_mark(0)
: ll_offset(off), ll_has_ansi(false), ll_time(t), ll_millis(millis),
ll_opid(opid), ll_sub_offset(0), ll_valid_utf(1), ll_level(lev),
ll_module_id(mod), ll_expr_mark(0)
{
memset(this->ll_schema, 0, sizeof(this->ll_schema));
}
logline(file_off_t off,
const struct timeval& tv,
log_level_t l,
log_level_t lev,
uint8_t mod = 0,
uint8_t opid = 0)
: ll_offset(off), ll_opid(opid), ll_sub_offset(0), ll_valid_utf(1),
ll_level(l), ll_module_id(mod), ll_expr_mark(0)
: ll_offset(off), ll_has_ansi(false), ll_opid(opid), ll_sub_offset(0),
ll_valid_utf(1), ll_level(lev), ll_module_id(mod), ll_expr_mark(0)
{
this->set_time(tv);
memset(this->ll_schema, 0, sizeof(this->ll_schema));

View File

@ -528,7 +528,7 @@ textfile_sub_source::rescan_files(
auto content = read_res.unwrap();
auto content_sf = string_fragment::from_str(content);
std::string frontmatter;
text_format_t frontmatter_format;
text_format_t frontmatter_format{text_format_t::TF_UNKNOWN};
auto cap_res = FRONT_MATTER_RE.capture_from(content_sf)
.into(md)
@ -541,7 +541,6 @@ textfile_sub_source::rescan_files(
} else if (md[2]) {
frontmatter_format = text_format_t::TF_TOML;
frontmatter = md[2]->to_string();
} else {
}
content_sf = cap_res->f_remaining;
} else if (content_sf.startswith("{")) {