mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-18 05:53:36 +01:00
Applied patch to close PR#bin/199
Submitted by: Toshihiro Kanda <candy@kgc.co.jp>
This commit is contained in:
parent
7439849253
commit
bcb0ec3dcd
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=15912
@ -316,11 +316,14 @@ appdstr(s, tp, len)
|
||||
if ((m = malloc(strlen(s) + len + 1)) == NULL)
|
||||
err("%s", strerror(errno));
|
||||
for (mp = m, sp = s; *mp++ = *sp++;);
|
||||
mp--;
|
||||
|
||||
if (*(mp - 1) == '\\')
|
||||
--mp;
|
||||
while ((ch = *mp++ = *tp++) && ch != '\n');
|
||||
*mp = '\0';
|
||||
memcpy(mp, tp, len);
|
||||
mp[len] = '\0';
|
||||
if (mp[len - 1] == '\n')
|
||||
mp[len - 1] = '\0';
|
||||
|
||||
free(s);
|
||||
return (m);
|
||||
|
Loading…
Reference in New Issue
Block a user