Skip to content

Commit

Permalink
Fixed error: modbus-esp8266/src/Modbus.cpp:318:25: error: comparison …
Browse files Browse the repository at this point in the history
…is always false due to limited range of data type [-Werror=type-limits]
  • Loading branch information
ArekKubacki committed Jun 5, 2023
1 parent ea2bd0e commit cd0de23
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit cd0de23

Please sign in to comment.