aboutsummaryrefslogtreecommitdiff
path: root/ld/ldlang.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2019-12-05 21:29:21 +1030
committerAlan Modra <amodra@gmail.com>2019-12-05 21:31:16 +1030
commit2410edcd3176d81d0ab8d24afe69f0d59649f69e (patch)
tree7d45b2e2247bb0036400162735cb7d7d956924a8 /ld/ldlang.c
parent2dc4b12fcd647b883223efeb308c277e629b369c (diff)
downloadgdb-2410edcd3176d81d0ab8d24afe69f0d59649f69e.zip
gdb-2410edcd3176d81d0ab8d24afe69f0d59649f69e.tar.gz
gdb-2410edcd3176d81d0ab8d24afe69f0d59649f69e.tar.bz2
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.
Diffstat (limited to 'ld/ldlang.c')
-rw-r--r--ld/ldlang.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ld/ldlang.c b/ld/ldlang.c
index bb3cd91..05ea0c8 100644
--- a/ld/ldlang.c
+++ b/ld/ldlang.c
@@ -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");
}
}