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

John Ralls jralls at code.gnucash.org
Sun Apr 5 15:16:41 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/8ccc1579 (commit)
	from  https://github.com/Gnucash/gnucash/commit/7189337b (commit)



commit 8ccc1579d92c5642045a26b3046dee5dfce6729e
Author: John Ralls <jralls at ceridwen.us>
Date:   Sun Apr 5 12:06:02 2020 -0700

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

diff --git a/libgnucash/engine/test/test-recurrence.c b/libgnucash/engine/test/test-recurrence.c
index 48c02cfbb..a0a802836 100644
--- a/libgnucash/engine/test/test-recurrence.c
+++ b/libgnucash/engine/test/test-recurrence.c
@@ -34,7 +34,6 @@ static gboolean check_valid(GDate *next, GDate *ref, GDate *start,
                         guint16 mult, PeriodType pt, WeekendAdjust wadj)
 {
     gboolean valid;
-    GDate adj_date;
     gint startToNext;
     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");
             else
             {
-                gboolean result;
+                gboolean result = TRUE;
                 if(!g_date_is_last_of_month(next))
                 {
-                    adj_date = *next;
+                    GDate adj_date = *next;
                     if(wadj == WEEKEND_ADJ_BACK)
                     {
                         // 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);
             if (day_start < 28)
             {
-                gboolean result;
+                gboolean result = TRUE;
                 week_day = g_date_get_weekday (next);
                 switch (wadj) {
                     case WEEKEND_ADJ_NONE:



Summary of changes:
 libgnucash/engine/test/test-recurrence.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)



More information about the gnucash-changes mailing list