diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-21 21:32:27 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2023-04-21 21:32:27 +0100 |
commit | cb066d59f5394beb88ac5b92c8a6db51494c9799 (patch) | |
tree | 9993d0a9750271d3b33b9e0ab48f22810f3f8b8f /libpqpp/pq-cursorselectcommand.cpp | |
parent | Suppress false warning (diff) | |
download | libdbpp-postgresql-cb066d59f5394beb88ac5b92c8a6db51494c9799.tar.bz2 libdbpp-postgresql-cb066d59f5394beb88ac5b92c8a6db51494c9799.tar.xz libdbpp-postgresql-cb066d59f5394beb88ac5b92c8a6db51494c9799.zip |
Don't use &vector.front() for vector which might be emptylibdbpp-postgresql-1.4.9
Instead just use .data() which safely returns something which might be nullptr, but that's fine.
Diffstat (limited to 'libpqpp/pq-cursorselectcommand.cpp')
-rw-r--r-- | libpqpp/pq-cursorselectcommand.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libpqpp/pq-cursorselectcommand.cpp b/libpqpp/pq-cursorselectcommand.cpp index 96d3dc3..8d3a7bf 100644 --- a/libpqpp/pq-cursorselectcommand.cpp +++ b/libpqpp/pq-cursorselectcommand.cpp @@ -46,7 +46,7 @@ PQ::CursorSelectCommand::execute() s_declare = mkdeclare(); } c->checkResultFree(PQexecParams(c->conn, s_declare.c_str(), static_cast<int>(values.size()), nullptr, - &values.front(), &lengths.front(), &formats.front(), binary), + values.data(), lengths.data(), formats.data(), binary), PGRES_COMMAND_OK); fetchTuples(); createColumns(execRes); |