summaryrefslogtreecommitdiff
path: root/libpqpp/pq-cursorselectcommand.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libpqpp/pq-cursorselectcommand.cpp')
-rw-r--r--libpqpp/pq-cursorselectcommand.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libpqpp/pq-cursorselectcommand.cpp b/libpqpp/pq-cursorselectcommand.cpp
index 2873067..820518f 100644
--- a/libpqpp/pq-cursorselectcommand.cpp
+++ b/libpqpp/pq-cursorselectcommand.cpp
@@ -62,13 +62,13 @@ bool
PQ::CursorSelectCommand::fetch()
{
execute();
- if ((tuple >= (nTuples - 1)) && (nTuples == fTuples)) {
+ if ((tuple + 1 >= nTuples) && (nTuples == fTuples)) {
// Delete the previous result set
PQclear(execRes);
execRes = nullptr;
fetchTuples();
}
- if (tuple++ < (nTuples - 1)) {
+ if (++tuple < nTuples) {
return true;
}
else {