public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4165] [Ada] Fix negative numbers formatted with leading zero
@ 2021-10-05  8:23 Pierre-Marie de Rodat
  0 siblings, 0 replies; only message in thread
From: Pierre-Marie de Rodat @ 2021-10-05  8:23 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:657d0d8faf8a9f5d0c221fa011cd66ae815e9a59

commit r12-4165-g657d0d8faf8a9f5d0c221fa011cd66ae815e9a59
Author: Pascal Obry <obry@adacore.com>
Date:   Thu Sep 16 16:23:55 2021 +0200

    [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:
---
 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 71d17f12b73..d6596126a8d 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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-10-05  8:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-05  8:23 [gcc r12-4165] [Ada] Fix negative numbers formatted with leading zero Pierre-Marie de Rodat

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).