diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-05-03 12:32:35 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2016-05-03 12:32:35 -0400 |
commit | a9f8c06d673af6c51153bc8008e58276cecfef6b (patch) | |
tree | d64ec38e9f89a97c60c2f61e859da318de89023f /builtin.c | |
parent | 315f1d61de4e536642e1bcf9f10903e3dd4f584b (diff) | |
parent | a6df7afc605079df7d85318846a522ef64aaa44d (diff) | |
download | egawk-a9f8c06d673af6c51153bc8008e58276cecfef6b.tar.gz egawk-a9f8c06d673af6c51153bc8008e58276cecfef6b.tar.bz2 egawk-a9f8c06d673af6c51153bc8008e58276cecfef6b.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'builtin.c')
-rw-r--r-- | builtin.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -670,7 +670,7 @@ format_tree( int i, nc; bool toofew = false; char *obuf, *obufout; - size_t osiz, ofre; + size_t osiz, ofre, olen_final; const char *chbuf; const char *s0, *s1; int cs1; @@ -1582,7 +1582,10 @@ mpf1: _("too many arguments supplied for format string")); } bchunk(s0, s1 - s0); - r = make_str_node(obuf, obufout - obuf, ALREADY_MALLOCED); + olen_final = obufout - obuf; + if (ofre > 0) + erealloc(obuf, char *, olen_final + 2, "format_tree"); + r = make_str_node(obuf, olen_final, ALREADY_MALLOCED); obuf = NULL; out: { |