diff options
-rw-r--r-- | navit/util.c | 17 | ||||
-rw-r--r-- | navit/util.h | 1 |
2 files changed, 18 insertions, 0 deletions
diff --git a/navit/util.c b/navit/util.c index 3c07f1411..d3125b05a 100644 --- a/navit/util.c +++ b/navit/util.c @@ -53,3 +53,20 @@ g_hash_to_list(GHashTable *h) return ret; } + +gchar * +g_strconcat_printf(gchar *buffer, gchar *fmt, ...) +{ + gchar *str,*ret; + va_list ap; + + va_start(ap, fmt); + str=g_strdup_vprintf(fmt, ap); + va_end(ap); + if (! buffer) + return str; + ret=g_strconcat(buffer, str, NULL); + g_free(buffer); + g_free(str); + return ret; +} diff --git a/navit/util.h b/navit/util.h index 19e6e06b9..8941afd6e 100644 --- a/navit/util.h +++ b/navit/util.h @@ -25,6 +25,7 @@ void strtoupper(char *dest, const char *src); void strtolower(char *dest, const char *src); GList * g_hash_to_list(GHashTable *h); +gchar * g_strconcat_printf(gchar *buffer, gchar *fmt, ...); #endif |