JohnF (archive)
Usenet Archive
- Joined
- Aug 14, 2006
- Messages
- 164
- Reaction score
- 0
Any problem with code of the form
unsigned char s[999] = "0123456789";
strcpy(s+2,s+4);
which, in this case, would result in "01456789" ?
Someone reported a problem with one of my programs
that he resolved by replacing this kind of strcpy
with an equivalent memmove after valgrind reported
the overlapping memory. But when I asked him what
input he used, so I could reproduce the problem,
he couldn't remember, and then he couldn't reproduce
the problem himself.
unsigned char s[999] = "0123456789";
strcpy(s+2,s+4);
which, in this case, would result in "01456789" ?
Someone reported a problem with one of my programs
that he resolved by replacing this kind of strcpy
with an equivalent memmove after valgrind reported
the overlapping memory. But when I asked him what
input he used, so I could reproduce the problem,
he couldn't remember, and then he couldn't reproduce
the problem himself.