From: Pascal Obry Date: Thu, 16 Sep 2021 14:23:55 +0000 (+0200) Subject: [Ada] Fix negative numbers formatted with leading zero X-Git-Tag: basepoints/gcc-13~4148 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=657d0d8faf8a9f5d0c221fa011cd66ae815e9a59;p=thirdparty%2Fgcc.git [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. --- 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