summaryrefslogtreecommitdiff
path: root/src/laminar.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2026-10-30 10:35:54 +0100
committerOliver Giles <ohw.giles@gmail.com>2026-11-02 11:27:47 +1300
commit9968f74ae957382d2c4e967564b307dbcc8eeaa2 (patch)
tree80301ab5db0dfacc320b7d44d993b1e611a6c72b /src/laminar.cpp
parent9d928ccad8c89c6f22892d167ea3842173ef62d1 (diff)
downloadlaminar-master.tar.gz
laminar-master.zip
Fix page count underflow for jobs with no completed runsHEADlocal/laminarmaster
The job status page computes the number of pages as (nRuns-1) / runsPerPage + 1 with nRuns unsigned. A job whose first run is still in progress has no completed builds, so nRuns is 0 and the subtraction wraps, displaying "Page 1 of 214748365". Report a single page in that case, and add a functional test for it.
Diffstat (limited to 'src/laminar.cpp')
-rw-r--r--src/laminar.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/laminar.cpp b/src/laminar.cpp
index e7ecf98..01c0c9c 100644
--- a/src/laminar.cpp
+++ b/src/laminar.cpp
@@ -307,7 +307,7 @@ std::string Laminar::getStatus(MonitorScope scope) {
.bind(scope.job)
.fetch<uint,uint>([&](uint nRuns, uint averageRuntime){
j.set("averageRuntime", averageRuntime);
- j.set("pages", (nRuns-1) / runsPerPage + 1);
+ j.set("pages", nRuns ? (nRuns-1) / runsPerPage + 1 : 1);
j.startObject("sort");
j.set("page", scope.page)
.set("field", scope.field)