summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-03 15:38:35 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2005-01-03 15:38:35 +0000
commit674b617ec8aba1fdccf685514a8ac02cdb7db461 (patch)
tree88baed5a54d66ab5b8cf7bcaafaec68f88edaea0
parent6c0ac121972a1b5706813e7be7934716a7298878 (diff)
downloadppe42-gcc-674b617ec8aba1fdccf685514a8ac02cdb7db461.tar.gz
ppe42-gcc-674b617ec8aba1fdccf685514a8ac02cdb7db461.zip
* i-cstrin.adb (Update): Do not append a null in form called with a
String. This avoids unintended behavior. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@92840 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/i-cstrin.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ada/i-cstrin.adb b/gcc/ada/i-cstrin.adb
index 26bde07c2ab..6adb48ad94e 100644
--- a/gcc/ada/i-cstrin.adb
+++ b/gcc/ada/i-cstrin.adb
@@ -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;
-----------
OpenPOWER on IntegriCloud