From 657d0d8faf8a9f5d0c221fa011cd66ae815e9a59 Mon Sep 17 00:00:00 2001 From: Pascal Obry Date: Thu, 16 Sep 2021 16:23:55 +0200 Subject: [PATCH] [Ada] Fix negative numbers formatted with leading zero gcc/ada/ * libgnat/g-forstr.adb (Get_Formatted): Fix computation of the number of zero to use in the formatted string. This was a wrong copy/paste. --- gcc/ada/libgnat/g-forstr.adb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gcc/ada/libgnat/g-forstr.adb b/gcc/ada/libgnat/g-forstr.adb index 71d17f12b73f..d6596126a8d9 100644 --- a/gcc/ada/libgnat/g-forstr.adb +++ b/gcc/ada/libgnat/g-forstr.adb @@ -424,7 +424,7 @@ package body GNAT.Formatted_String is and then F_Spec.Zero_Pad and then F_Spec.Width > Len + Value'First - S then - Append (Res, String'((F_Spec.Width - Len + Value'First - S) * '0')); + Append (Res, String'((F_Spec.Width - (Len + Value'First - S)) * '0')); end if; -- Add the value now -- 2.47.2