aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorAndrew J. Schorr <aschorr@telemetry-investments.com>2016-05-03 12:43:30 -0400
committerAndrew J. Schorr <aschorr@telemetry-investments.com>2016-05-03 12:43:30 -0400
commit7eed1513d0834de26528551f990372a5c2674ef2 (patch)
treec3bb53d853e820078abcc9cc4155430430ecc1bf /builtin.c
parenta9f8c06d673af6c51153bc8008e58276cecfef6b (diff)
downloadegawk-7eed1513d0834de26528551f990372a5c2674ef2.tar.gz
egawk-7eed1513d0834de26528551f990372a5c2674ef2.tar.bz2
egawk-7eed1513d0834de26528551f990372a5c2674ef2.zip
Stop wasting extra byte at the end of sprintf strings.
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/builtin.c b/builtin.c
index 31c13a81..77314d48 100644
--- a/builtin.c
+++ b/builtin.c
@@ -722,7 +722,7 @@ format_tree(
emalloc(obuf, char *, INITIAL_OUT_SIZE, "format_tree");
obufout = obuf;
osiz = INITIAL_OUT_SIZE;
- ofre = osiz - 2;
+ ofre = osiz - 1;
cur_arg = 1;
@@ -1584,7 +1584,7 @@ mpf1:
bchunk(s0, s1 - s0);
olen_final = obufout - obuf;
if (ofre > 0)
- erealloc(obuf, char *, olen_final + 2, "format_tree");
+ erealloc(obuf, char *, olen_final + 1, "format_tree");
r = make_str_node(obuf, olen_final, ALREADY_MALLOCED);
obuf = NULL;
out: