Re: how to replace a substring in a string using C?



On Sun, 30 Oct 2005 20:40:58 +0000, Netocrat wrote:
[...]
> ret = malloc(i + count * (newlen - oldlen));

Off-by-one; should be:
ret = malloc(i + 1 + count * (newlen - oldlen));

--
http://members.dodo.com.au/~netocrat

.