exec_alt was failing its tests on Mac OS X (but passing them on Linux).
It turns out that this is because it was failing to NULL terminate the
string that it creates in construct_alt(), which copies in the
characters from argv0, prefix and suffix, but never copies in a trailing
NULL.
Amend the code so that the trailing NULL from suffix is used to
terminate the string.
Change-Id: I286604fb09193367c4e7b2d80051832080362f79
Reviewed-on: http://gerrit.openafs.org/4267
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
memmove(replace + prefix_len, replace, replace_len);
memcpy(replace, prefix, prefix_len);
/* basically strcat(replace, suffix), but a touch faster */
- memcpy(replace + prefix_len + replace_len, suffix, suffix_len);
+ memcpy(replace + prefix_len + replace_len, suffix, suffix_len + 1);
return alt;
}