Use unsigned, not size_t, for serializing tag stack size

This commit is contained in:
Max Brunsfeld 2018-07-18 11:32:04 -07:00
parent 70533673a2
commit e74795bc0d
1 changed files with 2 additions and 2 deletions

View File

@ -27,7 +27,7 @@ struct Scanner {
unsigned serialize(char *buffer) {
unsigned i = 0;
size_t n = tags.size();
unsigned n = tags.size();
std::memcpy(buffer, &n, sizeof(n));
i += sizeof(n);
for (unsigned j = 0; j < n; j++) {
@ -51,7 +51,7 @@ struct Scanner {
tags.clear();
if (length > 0) {
unsigned i = 0;
size_t n;
unsigned n;
std::memcpy(&n, buffer, sizeof(n));
i += sizeof(n);
tags.resize(n);