diff --git a/src/common/kiwix/searcher.cpp b/src/common/kiwix/searcher.cpp index 26ab55e0..50b3860c 100644 --- a/src/common/kiwix/searcher.cpp +++ b/src/common/kiwix/searcher.cpp @@ -215,7 +215,7 @@ namespace kiwix { oData["resultStart"] = this->resultStart + 1; oData["resultEnd"] = (this->resultEnd > this->estimatedResultCount ? this->estimatedResultCount : this->resultEnd); oData["resultRange"] = this->resultRange; - oData["resultLastPageStart"] = this->estimatedResultCount - this->resultRange; + oData["resultLastPageStart"] = this->estimatedResultCount > this->resultRange ? this->estimatedResultCount - this->resultRange : 0; oData["protocolPrefix"] = this->protocolPrefix; oData["searchProtocolPrefix"] = this->searchProtocolPrefix; diff --git a/static/results.tmpl b/static/results.tmpl index a6711f80..ee002301 100644 --- a/static/results.tmpl +++ b/static/results.tmpl @@ -114,13 +114,13 @@