This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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.

diff --git a/ld/ldlang.c b/ld/ldlang.c
index bb3cd91215..05ea0c881f 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");
     }
 }

-- 
Alan Modra
Australia Development Lab, IBM


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]