From 16d98db66682acc92c4ef591627e69c9c65e3080 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Fri, 25 Apr 2008 10:17:35 +0200 Subject: [PATCH] [titlebar] Fix buffer allocation Signed-off-by: Julien Danjou --- titlebar.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/titlebar.c b/titlebar.c index 3dd49947e..df6902e08 100644 --- a/titlebar.c +++ b/titlebar.c @@ -38,10 +38,9 @@ titlebar_markup_parse(client_t *c, const char *str, ssize_t len) int i = 0; ssize_t clen; - new = p_new(char, len++); + new = p_new(char, ++len); for(ps = str; *ps; ps++, i++) - { if(*ps == '%') { ps++; @@ -58,7 +57,6 @@ titlebar_markup_parse(client_t *c, const char *str, ssize_t len) } else new[i] = *ps; - } return new; }