This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp_formline: don't overgrow PL_formtarget
authorDavid Mitchell <davem@iabyn.com>
Sun, 29 May 2011 13:01:11 +0000 (14:01 +0100)
committerDavid Mitchell <davem@iabyn.com>
Sun, 29 May 2011 19:21:53 +0000 (20:21 +0100)
commitbf2bec63bfe4a40a7b64fc7688213cbfa85b1418
tree343d5912578b6e4985df0e010ab3f33b5c67766f
parent9dec788bd5a908311909e9ba11d34ff71be22e88
pp_formline: don't overgrow PL_formtarget

In various places, PL_formtarget is grown by fudge bytes.
But fudge is already equal to the whole width of the format line,
and PL_formtarget is pre-grown by fudge at the start, so normally
there's no need to extend it further. So don't.
Instead, only grow it by the amount needed (which will ormally be nothing)
as a safety measure.

Also add an assert at the end to check that we haven't overrun the buffer.
pp_ctl.c