gnucash maint: Windows Build failure in dialog-dup-trans.c

Robert Fewell bobit at code.gnucash.org
Tue Nov 10 14:20:03 EST 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/a519b913 (commit)
	from  https://github.com/Gnucash/gnucash/commit/49b3bdeb (commit)



commit a519b913a6067f44ef699d504a8955ffdc49930d
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Nov 10 19:05:37 2020 +0000

    Windows Build failure in dialog-dup-trans.c
    
    Windows build failed on creating gchar *format with g_strdup_printf
    parameter '%ld' expects argument of type 'long int', but argument 3 has
    type 'size_t' {aka 'unsigned int'}
    Fixed by replacing strlen with g_utf8_strlen.

diff --git a/gnucash/gnome-utils/dialog-dup-trans.c b/gnucash/gnome-utils/dialog-dup-trans.c
index 329ecafb1..6db255881 100644
--- a/gnucash/gnome-utils/dialog-dup-trans.c
+++ b/gnucash/gnome-utils/dialog-dup-trans.c
@@ -95,7 +95,7 @@ gnc_dup_inc_dec (GtkWidget *widget, const gchar *text, gint inc_dec)
             num = 0;
 
         if (g_str_has_prefix (text, "0"))
-            format = g_strdup_printf ("%s%ld%s", "%0", strlen (text), "d");
+            format = g_strdup_printf ("%s%ld%s", "%0", g_utf8_strlen (text, -1), "d");
         else
             format = g_strdup_printf ("%s", "%ld");
 



Summary of changes:
 gnucash/gnome-utils/dialog-dup-trans.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



More information about the gnucash-changes mailing list