outbin: Fix infinite dashes written to map file

Unfortunately, there is an assumption that the section name is bounded to '65'
characters and dashes have been appended so far. A simple fix for this report:

https://bugzilla.nasm.us/show_bug.cgi?id=3392564

We may need to cleanup further for those hardcoded numbers in decorating the
section info.

Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
This commit is contained in:
Chang S. Bae 2019-04-26 23:15:36 -07:00 committed by Cyrill Gorcunov
parent 55f3dd5792
commit 0995aa24aa

View File

@ -606,6 +606,7 @@ static void bin_cleanup(void)
fprintf(rf, "\n\n");
list_for_each(s, sections) {
fprintf(rf, "---- Section %s ", s->name);
if (strlen(s->name) < 65)
for (h = 65 - strlen(s->name); h; h--)
fputc('-', rf);
fprintf(rf, "\n\nclass: ");