Fix build

master
Jeremy Hu 2018-10-17 12:53:18 +08:00
parent b2a77caffc
commit c06a23d52e
1 changed files with 2 additions and 1 deletions

View File

@ -99,7 +99,8 @@ uint64_t Reader::readUint64()
std::string Reader::readString(uint32_t length) std::string Reader::readString(uint32_t length)
{ {
char buffer[length + 1]; std::vector<char> bufferVector(length + 1);
char *buffer = bufferVector.data();
buffer[length] = 0; buffer[length] = 0;
if(length) read(buffer, length); if(length) read(buffer, length);
return std::string(buffer); return std::string(buffer);