Implement fix from https://github.com/cosmoderp/Marlin/commit/5c8e1e7d4af37e25fb9040dcbf690bbb089948e6
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
|
||||
// Make sure DWIN_SendBuf is large enough to hold the largest
|
||||
// printed string plus the draw command and tail.
|
||||
uint8_t DWIN_SendBuf[11 + 24] = { 0xAA };
|
||||
uint8_t DWIN_SendBuf[11 + DWIN_WIDTH / 8] = { 0xAA };
|
||||
uint8_t DWIN_BufTail[4] = { 0xCC, 0x33, 0xC3, 0x3C };
|
||||
uint8_t databuf[26] = { 0 };
|
||||
uint8_t receivedType;
|
||||
@@ -63,7 +63,7 @@ inline void DWIN_Long(size_t &i, const uint32_t lval) {
|
||||
}
|
||||
|
||||
inline void DWIN_String(size_t &i, char * const string) {
|
||||
const size_t len = strlen(string);
|
||||
const size_t len = _MIN(sizeof(DWIN_SendBuf) - i, strlen(string));
|
||||
memcpy(&DWIN_SendBuf[i+1], string, len);
|
||||
i += len;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user