Check the length of the buffer against the specified maximum length. If the buffer is too long, set it to maximum.
buffer to check the length of
maximum number of characters in buffer
the truncated buffer
See Implementation
Check the length of the buffer against the specified maximum length. If the buffer is too long, set it to maximum.