Re: PR25244, --print-memory-usage, division by zero if MEMORY length is zero

Do print the linefeed when length is zero.

	PR 25244
	* ldlang.c (lang_print_memory_usage): Correct last patch.
This commit is contained in:
Alan Modra 2019-12-05 21:29:21 +10:30
parent 2dc4b12fcd
commit 2410edcd31
2 changed files with 7 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2019-12-05 Alan Modra <amodra@gmail.com>
PR 25244
* ldlang.c (lang_print_memory_usage): Correct last patch.
2019-12-05 Alan Modra <amodra@gmail.com>
PR 25243

View File

@ -9281,7 +9281,8 @@ lang_print_memory_usage (void)
if (r->length != 0)
{
double percent = used_length * 100.0 / r->length;
printf (" %6.2f%%\n", percent);
printf (" %6.2f%%", percent);
}
printf ("\n");
}
}