]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
i-cstrin.adb (Update): Do not append a null in form called with a String.
authorArnaud Charlet <charlet@gcc.gnu.org>
Mon, 3 Jan 2005 15:38:35 +0000 (16:38 +0100)
committerArnaud Charlet <charlet@gcc.gnu.org>
Mon, 3 Jan 2005 15:38:35 +0000 (16:38 +0100)
* i-cstrin.adb (Update): Do not append a null in form called with a
String. This avoids unintended behavior.

From-SVN: r92840

gcc/ada/i-cstrin.adb

index 26bde07c2ab67d9bb50e8a49779c70d323555b5a..6adb48ad94e81078b71ab3044cda6273b89a8b8c 100644 (file)
@@ -250,7 +250,13 @@ package body Interfaces.C.Strings is
       Check  : Boolean := True)
    is
    begin
-      Update (Item, Offset, To_C (Str), Check);
+      --  Note: in RM 95, the Append_Nul => False parameter is omitted. But
+      --  this has the unintended consequence of truncating the string after
+      --  an update. As discussed in Ada 2005 AI-242, this was unintended,
+      --  and should be corrected. Since this is a clear error, it seems
+      --  appropriate to apply the correction in Ada 95 mode as well.
+
+      Update (Item, Offset, To_C (Str, Append_Nul => False), Check);
    end Update;
 
    -----------