From 8dc7f960157a7132575f37989dc5e5def893f7d0 Mon Sep 17 00:00:00 2001 From: Lars-Dominik Braun Date: Tue, 12 Jun 2012 23:15:44 +0200 Subject: [PATCH] Fix strfsong behaviour for unknown identifier [jn: adjusted the white space style] --- src/strfsong.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/strfsong.c b/src/strfsong.c index 3d5abd5..e3d4eb9 100644 --- a/src/strfsong.c +++ b/src/strfsong.c @@ -243,12 +243,12 @@ _strfsong(gchar *s, if( temp == NULL) { gsize templen=n; /* just pass-through any unknown specifiers (including esc) */ - /* drop a null char in so printf stops at the end of this specifier, - but put the real character back in (pseudo-const) */ if( length+templen > max ) templen = max-length; - g_strlcat(s, p,max); + gchar *ident = g_strndup(p, templen); + g_strlcat(s, ident, max); length+=templen; + g_free(ident); } else { gsize templen = strlen(temp); -- 2.30.2