From 8fc77a4365f598d6273bcaac8dfac4731269ab36 Mon Sep 17 00:00:00 2001 From: Nan Xiao Date: Thu, 7 Mar 2019 13:49:27 +0800 Subject: [PATCH] Fix build warning --- tests/singleheadertest.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/singleheadertest.cpp b/tests/singleheadertest.cpp index 052196f1..8e890462 100644 --- a/tests/singleheadertest.cpp +++ b/tests/singleheadertest.cpp @@ -8,7 +8,9 @@ int main() { if( ! pj.isValid() ) { return EXIT_FAILURE; } - pj.allocateCapacity(p.size()); + if( ! pj.allocateCapacity(p.size()) ) { + return EXIT_FAILURE; + } const int res = json_parse(p, pj); if (res) { std::cerr << simdjson::errorMsg(res) << std::endl;