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; } } }