Skip to content

Commit

Permalink
fix msvc assert failed when string resize
Browse files Browse the repository at this point in the history
  • Loading branch information
poor-circle committed Mar 17, 2024
1 parent a2b65ab commit e161c14
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/ylt/struct_pack/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ inline void resize(std::basic_string<ch> &raw_str, std::size_t sz) {
str.reserve(sz * sizeof(ch));
}
string_set_length_hacker(str, sz);
for (auto i = sz; i < sz + sizeof(ch); ++i) str[i] = '\0';
*(str.data() + sz) = 0;
#else
raw_str.resize(sz);
#endif
Expand Down

0 comments on commit e161c14

Please sign in to comment.