aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2005-01-03 16:38:35 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2005-01-03 16:38:35 +0100
commit8bded5832c16b8db84229ba5826504149b180043 (patch)
tree88baed5a54d66ab5b8cf7bcaafaec68f88edaea0 /gcc
parent3e69e63bd19c0c21c40d6bfa38acc7dbe8a78293 (diff)
downloadgcc-8bded5832c16b8db84229ba5826504149b180043.zip
gcc-8bded5832c16b8db84229ba5826504149b180043.tar.gz
gcc-8bded5832c16b8db84229ba5826504149b180043.tar.bz2
i-cstrin.adb (Update): Do not append a null in form called with a String.
* i-cstrin.adb (Update): Do not append a null in form called with a String. This avoids unintended behavior. From-SVN: r92840
Diffstat (limited to 'gcc')
-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 26bde07..6adb48a 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;
-----------