diff options
author | Pascal Obry <obry@adacore.com> | 2021-09-16 16:23:55 +0200 |
---|---|---|
committer | Pierre-Marie de Rodat <derodat@adacore.com> | 2021-10-05 08:20:04 +0000 |
commit | 657d0d8faf8a9f5d0c221fa011cd66ae815e9a59 (patch) | |
tree | f6aee6ab1e536484da51a300e161c4ba1950b49f | |
parent | b2b2fe2d679dec37e30b86c73fefa9d7e920f4ca (diff) | |
download | gcc-657d0d8faf8a9f5d0c221fa011cd66ae815e9a59.zip gcc-657d0d8faf8a9f5d0c221fa011cd66ae815e9a59.tar.gz gcc-657d0d8faf8a9f5d0c221fa011cd66ae815e9a59.tar.bz2 |
[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.
-rw-r--r-- | gcc/ada/libgnat/g-forstr.adb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ada/libgnat/g-forstr.adb b/gcc/ada/libgnat/g-forstr.adb index 71d17f1..d659612 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 |