Use the MIN() macro where possible instead of manual "(x < y) ? x : y" constructs.
This commit is contained in:
parent
fa5c8700bc
commit
8f5ab27dc9
8 changed files with 15 additions and 22 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue