Skip to content

Commit

Permalink
Merge pull request #110 from n1000/bad_memcpy
Browse files Browse the repository at this point in the history
Use memmove() instead of memcpy() for overlapping memory regions
  • Loading branch information
ch-aurich authored May 21, 2017
2 parents 2abd3b9 + 20f4f6c commit 301c063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion serial/ptsctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static void cycle (char * string, unsigned offset, unsigned length)

{
signed c = string [offset];
memcpy (&string [offset], &string [offset + 1], length);
memmove (&string [offset], &string [offset + 1], length);
string [offset + length] = c;
return;
}
Expand Down

0 comments on commit 301c063

Please sign in to comment.