> Is it really a performance problem? Avoiding this kind of pointer/buffer > size juggling is one of the reasons for using strlcpy/strlcat. > > Without this, you have a quadratic behaviour for a function working with paths, which I consider a really bad thing. Also I don't see the link between strlcat and point juggling. My only point was that if you know a string S already is N character long, you can strlcat at S+N and avoid rescanning it and without any risks because if your buffer size of size M then S+N is of size M-N.
As for the -1, I didn't pay attention but it seems to me that it is an unrelated problem.