diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-12-14 20:38:14 +0200 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-12-14 20:38:14 +0200 |
commit | c55956b6a10d0a4d0b151c1be976dc9c344c1103 (patch) | |
tree | 8711c2b5a501af116782f470fa5c0ec9e18dbabf /profile.c | |
parent | b6ac928a53d146233741fc5f7fe1cac66de27303 (diff) | |
download | egawk-c55956b6a10d0a4d0b151c1be976dc9c344c1103.tar.gz egawk-c55956b6a10d0a4d0b151c1be976dc9c344c1103.tar.bz2 egawk-c55956b6a10d0a4d0b151c1be976dc9c344c1103.zip |
More fixes to stop allocating an extra byte.
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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) { |