On Sun, 07 May 2006 14:21:20 +0200
Per Jessen
valgrind always complains about overlapping strcpy()s, even when the src-address is clearly > dst-address. I know the strcpy manpage says the operands may not overlap, but surely an overlap where src>dst is still ok? Why is valgrind unhappy about it? It does not matter if src < dst or dst < src. What matters is that dst does not lie anywhere in src, or vice versa.
Many times, in string processing I have had situations like:
char *dst = "abcd":
char *src = dst + 2;
strcpy(dst, src);
In this case the result will be "cd".
But, there is also an overlap.
--
Jerry Feldman