push string - only push a max of 255 chars.

This commit is contained in:
ksherlock 2019-12-10 10:29:45 -05:00 committed by GitHub
parent 12bae449ba
commit b55305d11c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,7 +86,7 @@ void push(std::vector<uint8_t> &v, uint32_t x) {
void push(std::vector<uint8_t> &v, const std::string &s) {
uint8_t count = std::min((int)s.size(), 255);
push(v, count);
v.insert(v.end(), s.begin(), s.end());
v.insert(v.end(), s.begin(), s.begin() + count);
}
class super_helper {
@ -501,4 +501,4 @@ void save_omf(const std::string &path, std::vector<omf::segment> &segments, bool
}
close(fd);
}
}