Use the MIN() macro where possible instead of manual "(x < y) ? x : y" constructs.

This commit is contained in:
Dean Camera 2011-03-23 09:26:41 +00:00
parent fa5c8700bc
commit 8f5ab27dc9
8 changed files with 15 additions and 22 deletions

View file

@ -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);