Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fixed error: modbus-esp8266/src/Modbus.cpp:318:25: error: comparison is always false due to limited range of data type [-Werror=type-limits]
  • Loading branch information
ArekKubacki committed Jun 5, 2023
commit cd0de238a08db8a29b4182f8ba05b482b5f35111
8 changes: 4 additions & 4 deletions src/Modbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,10 @@ void Modbus::slavePDU(uint8_t* frame) {
bufSize += recLen * 2 + 2; // 4 bytes for header + data
recs += 7;
}
if (bufSize > MODBUS_MAX_FRAME) { // Frame to return too large
exceptionResponse(fcode, EX_ILLEGAL_ADDRESS);
return;
}
// if (bufSize > MODBUS_MAX_FRAME) { // Frame to return too large
// exceptionResponse(fcode, EX_ILLEGAL_ADDRESS);
// return;
// }
uint8_t* srcFrame = _frame;
_frame = (uint8_t*)malloc(bufSize);
if (!_frame) {
Expand Down