gas: buffer_and_nest() needs to pass nul-terminated string to temp_ilp()
authorJan Beulich <jbeulich@suse.com>
Wed, 15 Feb 2023 07:46:02 +0000 (08:46 +0100)
committerJan Beulich <jbeulich@suse.com>
Wed, 15 Feb 2023 07:46:02 +0000 (08:46 +0100)
commitc22a74728313ee35f6bf143238d42e2eca9ed020
tree6b56a509cb53e2d5ffbd2971d1438beb63632616
parentc91714309754e27f7f3a6ffc08ba61739c418532
gas: buffer_and_nest() needs to pass nul-terminated string to temp_ilp()

In 7545aa2dd2eb ("gas: improve interaction between read_a_source_file()
and s_linefile()") I didn't pay attention to the dual purpose of the
nul character previously used. This was to a fair degree because of the
open-coding of certain operations. Insert the earlier found line
terminator instead of a hard-coded newline, and do so early in this
special case (bypassing the later general insertion point). Plus
properly use sb_terminate() to mark the end of the string. (Note that
saved_eol_char was misnamed: Without calling sb_terminate() there's
simply random data at that position in the buffer.)
gas/macro.c