Bug 797666 - libgnucash/engine/test/test-recurrence.c: In function 'check_valid': 'result' may be used uninitialized

This commit is contained in:
John Ralls 2020-04-05 12:06:02 -07:00
parent 7189337b02
commit 8ccc1579d9

View File

@ -34,7 +34,6 @@ static gboolean check_valid(GDate *next, GDate *ref, GDate *start,
guint16 mult, PeriodType pt, WeekendAdjust wadj) guint16 mult, PeriodType pt, WeekendAdjust wadj)
{ {
gboolean valid; gboolean valid;
GDate adj_date;
gint startToNext; gint startToNext;
gboolean ret_val = TRUE; gboolean ret_val = TRUE;
@ -65,10 +64,10 @@ static gboolean check_valid(GDate *next, GDate *ref, GDate *start,
ret_val &= do_test(g_date_is_last_of_month(next), "end of month phase wrong"); ret_val &= do_test(g_date_is_last_of_month(next), "end of month phase wrong");
else else
{ {
gboolean result; gboolean result = TRUE;
if(!g_date_is_last_of_month(next)) if(!g_date_is_last_of_month(next))
{ {
adj_date = *next; GDate adj_date = *next;
if(wadj == WEEKEND_ADJ_BACK) if(wadj == WEEKEND_ADJ_BACK)
{ {
// If adjusting back, one of the next two days to be end of month // If adjusting back, one of the next two days to be end of month
@ -133,7 +132,7 @@ static gboolean check_valid(GDate *next, GDate *ref, GDate *start,
day_next = g_date_get_day(next); day_next = g_date_get_day(next);
if (day_start < 28) if (day_start < 28)
{ {
gboolean result; gboolean result = TRUE;
week_day = g_date_get_weekday (next); week_day = g_date_get_weekday (next);
switch (wadj) { switch (wadj) {
case WEEKEND_ADJ_NONE: case WEEKEND_ADJ_NONE: