diff --git a/src/line_buffer.cc b/src/line_buffer.cc index e27cde36..a0899e64 100644 --- a/src/line_buffer.cc +++ b/src/line_buffer.cc @@ -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; diff --git a/src/log_format_fwd.hh b/src/log_format_fwd.hh index af8a7254..8b9d3017 100644 --- a/src/log_format_fwd.hh +++ b/src/log_format_fwd.hh @@ -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)); diff --git a/src/textfile_sub_source.cc b/src/textfile_sub_source.cc index ce3d084c..c9996b54 100644 --- a/src/textfile_sub_source.cc +++ b/src/textfile_sub_source.cc @@ -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("{")) {