X-Git-Url: http://git.linex4red.de/pub/lufa.git/blobdiff_plain/071e02c6b6b4837fa9cf0b6d4c749994e02638d7..fc92f9969c1fcc2f952f0bd6d09a309a9b3ce02f:/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c diff --git a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c index 2d8183746..fa1a651e6 100644 --- a/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c +++ b/Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c @@ -63,12 +63,12 @@ int16_t ICMP_ProcessICMPPacket(Ethernet_Frame_Info_t* FrameIN, void* InDataStart ICMPHeaderOUT->Id = ICMPHeaderIN->Id; ICMPHeaderOUT->Sequence = ICMPHeaderIN->Sequence; - uint16_t DataSize = FrameIN->FrameLength - ((((uint16_t)InDataStart + sizeof(ICMP_Header_t)) - (uint16_t)FrameIN->FrameData)); + intptr_t DataSize = FrameIN->FrameLength - ((((intptr_t)InDataStart + sizeof(ICMP_Header_t)) - (intptr_t)FrameIN->FrameData)); /* Copy the remaining payload to the response - echo requests should echo back any sent data */ - memcpy(&((uint8_t*)OutDataStart)[sizeof(ICMP_Header_t)], - &((uint8_t*)InDataStart)[sizeof(ICMP_Header_t)], - DataSize); + memmove(&((uint8_t*)OutDataStart)[sizeof(ICMP_Header_t)], + &((uint8_t*)InDataStart)[sizeof(ICMP_Header_t)], + DataSize); ICMPHeaderOUT->Checksum = Ethernet_Checksum16(ICMPHeaderOUT, (DataSize + sizeof(ICMP_Header_t)));