From 7bb6a8c32d8bd2b8491a4fa2575787b6daec520a Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Mon, 20 Jul 2009 11:21:05 +0000 Subject: [PATCH] Add warning about reusing string buffer in utils_build_path(). git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@3995 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- src/utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils.c b/src/utils.c index 6ebd420e..6c9e4037 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1602,7 +1602,9 @@ gboolean utils_spawn_async(const gchar *dir, gchar **argv, gchar **env, GSpawnFl /* Similar to g_build_path() but (re)using a fixed buffer, so never free it. * This assumes a small enough resulting string length to be kept without freeing, - * but this should be the case for filenames. */ + * but this should be the case for filenames. + * @warning As the buffer is reused, you can't call this recursively, e.g. for a + * function argument and within the function called. */ const gchar *utils_build_path(const gchar *first, ...) { static GString *buffer = NULL;