[titlebar] Fix buffer allocation

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-04-25 10:17:35 +02:00
parent b348af16e2
commit 16d98db666
1 changed files with 1 additions and 3 deletions

View File

@ -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;
}