X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/fa5c8700bc0f9efb36f779e217c9fd1e81f8efb6..8f5ab27dc9b2a7c4944a5e7d149f39959ead477e:/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.c diff --git a/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.c b/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.c index 1cc907862..019329e2b 100644 --- a/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.c +++ b/Demos/Device/LowLevel/RNDISEthernet/Lib/Webserver.c @@ -181,7 +181,7 @@ void Webserver_ApplicationCallback(TCP_ConnectionState_t* const ConnectionState, uint16_t Length; /* Determine the length of the loaded block */ - Length = ((RemLength > HTTP_REPLY_BLOCK_SIZE) ? HTTP_REPLY_BLOCK_SIZE : RemLength); + Length = MIN(RemLength, HTTP_REPLY_BLOCK_SIZE); /* Copy the next buffer sized block of the page to the packet buffer */ strncpy_P(BufferDataStr, &HTTPPage[PageBlock * HTTP_REPLY_BLOCK_SIZE], Length);