From 99b4f34f52e8dfea5f4a36266f7d01a11612d4f5 Mon Sep 17 00:00:00 2001 From: moneroexamples Date: Wed, 10 May 2017 17:22:30 +0800 Subject: [PATCH] fix: possible division by 0 --- src/page.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/page.h b/src/page.h index 6d05ef2..f7ef443 100644 --- a/src/page.h +++ b/src/page.h @@ -4092,8 +4092,7 @@ namespace xmreg j_data["page"] = page; j_data["limit"] = limit; j_data["current_height"] = height; - j_data["total_page_no"] = (height / limit); - + j_data["total_page_no"] = (limit == 0 ? 0 : height / limit); j_response["status"] = "success";