From c55956b6a10d0a4d0b151c1be976dc9c344c1103 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sun, 14 Dec 2014 20:38:14 +0200 Subject: More fixes to stop allocating an extra byte. --- profile.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'profile.c') diff --git a/profile.c b/profile.c index ad879a3c..45eb562c 100644 --- a/profile.c +++ b/profile.c @@ -1337,7 +1337,7 @@ pp_string(const char *in_str, size_t len, int delim) osiz *= 2; \ } ofre -= (l) - osiz = len + 3 + 2; /* initial size; 3 for delim + terminating null */ + osiz = len + 3 + 1; /* initial size; 3 for delim + terminating null */ emalloc(obuf, char *, osiz, "pp_string"); obufout = obuf; ofre = osiz - 1; @@ -1505,7 +1505,7 @@ pp_concat(int nargs) len = -delimlen; for (i = nargs; i >= 1; i--) { r = pp_args[i] = pp_pop(); - len += r->pp_len + delimlen + 2; + len += r->pp_len + delimlen + 1; } emalloc(str, char *, len + 1, "pp_concat"); @@ -1571,7 +1571,7 @@ pp_group3(const char *s1, const char *s2, const char *s3) len1 = strlen(s1); len2 = strlen(s2); len3 = strlen(s3); - l = len1 + len2 + len3 + 2; + l = len1 + len2 + len3 + 1; emalloc(str, char *, l, "pp_group3"); s = str; if (len1 > 0) { -- cgit v1.2.3