From 3a21e866ac46c33733b3a72d0fdfbce2d3cc72d2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 3 Mar 2019 13:37:49 +0000 Subject: More clang-tidy fixes --- libmysqlpp/unittests/testmysql.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'libmysqlpp/unittests') diff --git a/libmysqlpp/unittests/testmysql.cpp b/libmysqlpp/unittests/testmysql.cpp index ca4cbc0..7795a0b 100644 --- a/libmysqlpp/unittests/testmysql.cpp +++ b/libmysqlpp/unittests/testmysql.cpp @@ -106,10 +106,12 @@ BOOST_AUTO_TEST_CASE( bulkload ) // Test sample file ro->beginBulkUpload("bulktest", ""); std::ifstream in((rootDir / "bulk.sample").string()); - if (!in.good()) throw std::runtime_error("Couldn't open bulk.sample"); - char buf[BUFSIZ]; - for (std::streamsize r; (r = in.readsome(buf, sizeof(buf))) > 0; ) { - ro->bulkUploadData(buf, r); + if (!in.good()) { + throw std::runtime_error("Couldn't open bulk.sample"); + } + std::array buf {}; + for (std::streamsize r; (r = in.readsome(buf.data(), buf.size())) > 0; ) { + ro->bulkUploadData(buf.data(), r); } ro->endBulkUpload(nullptr); assertScalarValueHelper(*count, 800); -- cgit v1.2.3