2015-09-23 Thomas Schwinge <thomas@codesourcery.com>
+ * gcc.c (handle_foffload_option): Don't lose the trailing NUL
+ character when appending to offload_targets.
+
* configure.ac (offload_targets, OFFLOAD_TARGETS): Separate
offload targets by commas, not colons.
* config.in: Regenerate.
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);
}
}