From 54e69dbee146182a60c258076b8d26e8f5ac752a Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 26 May 2010 12:24:44 +0000 Subject: Switch to using the correct intptr_t type use where a pointer must be cast to an integer type. --- Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c') diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c index 02a401f6a..a43ffca54 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c @@ -62,12 +62,12 @@ int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart) 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))); -- cgit v1.2.3