From 83b2ec15faab5574028012ede42fbb6e6f756d8c Mon Sep 17 00:00:00 2001 From: niansa Date: Wed, 16 Sep 2020 14:34:54 +0200 Subject: [PATCH] Fixed maxposts --- libcommsy.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libcommsy.cpp b/libcommsy.cpp index a144db1..bf31a00 100644 --- a/libcommsy.cpp +++ b/libcommsy.cpp @@ -360,7 +360,7 @@ libCommsy::libCommsy(const std::string& _server_url, const std::string& _server_ auto gumboPosts = get_posts(document->root); if (gumboPosts.size() == 0) { // Stop fetching more data - break; + return; } // Map posts and their corresponding URL to a number @@ -401,9 +401,9 @@ libCommsy::libCommsy(const std::string& _server_url, const std::string& _server_ // Get lastID lastID = posts.back().id; // Check if maximum amount of posts to load was exceeded - if (numposts == max_posts) { + if (numposts >= max_posts) { // Stop loading more posts - break; + return; } } }