[PATCH 2/4] Close warning first might be garbage

Anton Lundin glance at acc.umu.se
Wed Dec 11 12:21:50 UTC 2013


First might be garbage if get_ranges would be called when
dive_table.nr == 0. This would rather signal that something else is
broken, but at least we shouldn't make it worse.

Signed-off-by: Anton Lundin <glance at acc.umu.se>
---
 statistics.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/statistics.c b/statistics.c
index 0c823b1..6a6d177 100644
--- a/statistics.c
+++ b/statistics.c
@@ -228,7 +228,7 @@ char *get_time_string(int seconds, int maxdays)
 static void get_ranges(char *buffer, int size)
 {
 	int i, len;
-	int first, last = -1;
+	int first = -1, last = -1;
 
 	snprintf(buffer, size, "%s", translate("gettextFromC","for dives #"));
 	for (i = 0; i < dive_table.nr; i++) {
-- 
1.8.3.2



More information about the subsurface mailing list