From 73ad5b1265bf2f7e3f0bfeea04d5eeea4cf117ee Mon Sep 17 00:00:00 2001 From: Christopher Lam Date: Wed, 15 Sep 2021 20:40:19 +0800 Subject: [PATCH] [gnc-glib-utils] use g_stpcpy instead of gnc_strcat g_stpcpy will use stpcpy wherever available. --- libgnucash/core-utils/gnc-glib-utils.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/libgnucash/core-utils/gnc-glib-utils.c b/libgnucash/core-utils/gnc-glib-utils.c index c15e1dd8d8..e79cf7e024 100644 --- a/libgnucash/core-utils/gnc-glib-utils.c +++ b/libgnucash/core-utils/gnc-glib-utils.c @@ -328,14 +328,6 @@ void gnc_gpid_kill(GPid pid) #endif /* G_OS_WIN32 */ } -static inline char* -gnc_strcat (char* dest, const char* src) -{ - while (*dest) dest++; - while ((*dest++ = *src++)); - return --dest; -} - gchar * gnc_g_list_stringjoin (GList *list_of_strings, const gchar *sep) { @@ -352,9 +344,9 @@ gnc_g_list_stringjoin (GList *list_of_strings, const gchar *sep) p = retval = (gchar*) g_malloc0 (length * sizeof (gchar) + 1); for (GList *n = list_of_strings; n; n = n->next) { - p = gnc_strcat (p, (gchar*)n->data); + p = g_stpcpy (p, (gchar*)n->data); if (n->next && sep) - p = gnc_strcat (p, sep); + p = g_stpcpy (p, sep); } return retval;