sanity check
This commit is contained in:
@@ -80,8 +80,8 @@ void LCDDisplay::writeLines(std::array<std::string, 4> lines) {
|
||||
|
||||
/* writes string to line buffer at given pos*/
|
||||
void LCDDisplay::writeBuf(uint8_t row, uint8_t col, std::string str) {
|
||||
// size_t max_copy = std::min(str.size(), sizeof(linebuf[row]) - col - 1);
|
||||
std::memcpy(&linebuf[row][col], str.c_str(), str.size()); // will overflow
|
||||
size_t len = std::min(str.size(), sizeof(linebuf[row]) - col);
|
||||
std::memcpy(&linebuf[row][col], str.c_str(), len); // will overflow
|
||||
}
|
||||
|
||||
/* hyper optimized buffer flush command, writes whole disp with a single write */
|
||||
|
||||
Reference in New Issue
Block a user