Close warning first might be garbage

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@acc.umu.se>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Anton Lundin 2013-12-11 21:21:50 +01:00 committed by Dirk Hohndel
parent 2c689964ab
commit 160fb321bc

View file

@ -228,7 +228,7 @@ char *get_time_string(int seconds, int maxdays)
static void get_ranges(char *buffer, int size) static void get_ranges(char *buffer, int size)
{ {
int i, len; int i, len;
int first, last = -1; int first = -1, last = -1;
snprintf(buffer, size, "%s", translate("gettextFromC","for dives #")); snprintf(buffer, size, "%s", translate("gettextFromC","for dives #"));
for (i = 0; i < dive_table.nr; i++) { for (i = 0; i < dive_table.nr; i++) {