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.
This commit is contained in:
Robert Fewell 2020-11-10 19:05:37 +00:00
parent 49b3bdeb09
commit a519b913a6

View File

@ -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");