Skip to content

Commit 2bbd962

Browse files
authored
Merge pull request #68 from r3mv/master
CheckRegister value does truncate negative values
2 parents c6f663b + f3c6e76 commit 2bbd962

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/com/intelligt/modbus/jlibmodbus/Modbus.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ static public boolean checkEndAddress(int value) {
290290
* @return "true" if register value is correct, else "false".
291291
*/
292292
static public boolean checkRegisterValue(int value) {
293-
return checkRange(value, 0, Modbus.MAX_REGISTER_VALUE);
293+
return checkRange((short)value, Short.MIN_VALUE, Short.MAX_VALUE);
294294
}
295295

296296
/**

0 commit comments

Comments
 (0)