If the length of a register name was greater than 15,
print_spaces was called with a negative number, which
prints random data from the heap instead of the requested
number of spaces.
This could happen if a target-description file was used
to specify additional long-named registers.
Fix is simple - don't ask for fewer than 1 space (since
we still want column separation).
Approved-by: Kevin Buettner <kevinb@redhat.com>
enum tab_stops { value_column_1 = 15 };
gdb_puts (name, file);
- print_spaces (value_column_1 - strlen (name), file);
+ print_spaces (std::max<int> (1, value_column_1 - strlen (name)), file);
try
{