Use unsigned, not size_t, for serializing tag stack size
This commit is contained in:
parent
70533673a2
commit
e74795bc0d
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue