From fc1f83fc998dd473d3066b5f062f9c899106b00a Mon Sep 17 00:00:00 2001 From: Huidae Cho Date: Fri, 13 Oct 2023 08:21:40 -0600 Subject: [PATCH] Use long total_count to avoid int overflow --- raster/r.stats/stats.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/raster/r.stats/stats.c b/raster/r.stats/stats.c index b0b72403c8b..7cc5552da71 100644 --- a/raster/r.stats/stats.c +++ b/raster/r.stats/stats.c @@ -27,7 +27,8 @@ struct Node { static struct Node **hashtable; static struct Node *node_list = NULL; -static int node_count = 0, total_count = 0; +static int node_count = 0; +static long total_count = 0; int initialize_cell_stats(int n) {