mirror of
git://git.suckless.org/sbase
synced 2025-01-02 21:12:15 +00:00
libutil: Remove free() from strnsub()
The free() was added in the wrong assumption that xargs was not freeing the argument in the position replaced, but it actually does it. Also, removing the call to free() makes more general the function.
This commit is contained in:
parent
4e8a096b1c
commit
22f110db28
@ -56,7 +56,6 @@ strnsubst(char **str, const char *match, const char *replstr, size_t maxsize)
|
||||
}
|
||||
strlcpy(s2 + s2len, s1, maxsize - s2len);
|
||||
done:
|
||||
free(*str);
|
||||
*str = s2;
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user