]> err.no Git - systemd/commitdiff
specifier: properly size newly allocated string
authorLennart Poettering <lennart@poettering.net>
Fri, 30 Apr 2010 00:16:22 +0000 (02:16 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 30 Apr 2010 00:16:22 +0000 (02:16 +0200)
specifier.c

index a25f33a047c118b8cef7bbc48ef21f52fafef3da..d8472e99ed445a89e6c9d0529bb1457ca2e8a996 100644 (file)
@@ -70,7 +70,7 @@ char *specifier_printf(const char *text, const Specifier table[], void *userdata
                                         j = t - r;
                                         k = strlen(w);
 
-                                        if (!(n = new(char, j + k + (l - (f - text)) + 1))) {
+                                        if (!(n = new(char, j + k + l + 1))) {
                                                 free(r);
                                                 free(w);
                                                 return NULL;