diff options
author | tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-09-23 14:52:57 +0000 |
---|---|---|
committer | tschwinge <tschwinge@138bc75d-0d04-0410-961f-82ee72b054a4> | 2015-09-23 14:52:57 +0000 |
commit | 3bf38a0b1ae8b2e8c382fa126c15ea815ac29b06 (patch) | |
tree | 31e8496656407278733d9ca32e9ffbe186b9129c /gcc/gcc.c | |
parent | daa8f58fd840e8d35f362306fb54e1963f4cbd0f (diff) | |
download | gcc-3bf38a0b1ae8b2e8c382fa126c15ea815ac29b06.tar.gz |
Fix --enable-offload-targets/-foffload handling, pt. 2
gcc/
* gcc.c (handle_foffload_option): Don't lose the trailing NUL
character when appending to offload_targets.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@228054 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gcc.c')
-rw-r--r-- | gcc/gcc.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/gcc.c b/gcc/gcc.c index 78b68e28aa6..ef132d6fece 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -3657,10 +3657,9 @@ handle_foffload_option (const char *arg) size_t offload_targets_len = strlen (offload_targets); offload_targets = XRESIZEVEC (char, offload_targets, - offload_targets_len + next - cur + 2); - if (offload_targets_len) - offload_targets[offload_targets_len++] = ':'; - memcpy (offload_targets + offload_targets_len, target, next - cur); + offload_targets_len + 1 + next - cur + 1); + offload_targets[offload_targets_len++] = ':'; + memcpy (offload_targets + offload_targets_len, target, next - cur + 1); } } |