Fix build warning

This commit is contained in:
Nan Xiao 2019-03-07 13:49:27 +08:00
parent 21eef55907
commit 8fc77a4365
1 changed files with 3 additions and 1 deletions

View File

@ -8,7 +8,9 @@ int main() {
if( ! pj.isValid() ) { if( ! pj.isValid() ) {
return EXIT_FAILURE; return EXIT_FAILURE;
} }
pj.allocateCapacity(p.size()); if( ! pj.allocateCapacity(p.size()) ) {
return EXIT_FAILURE;
}
const int res = json_parse(p, pj); const int res = json_parse(p, pj);
if (res) { if (res) {
std::cerr << simdjson::errorMsg(res) << std::endl; std::cerr << simdjson::errorMsg(res) << std::endl;