Skip to content

Commit

Permalink
snmp-ups: Actually fix commands offset (off by 1)
Browse files Browse the repository at this point in the history
The last fix was wrongly setting the offset to negative, and substracting it
again from the current device number, which resulted in an addition, not a
substraction

Signed-off-by: Arnaud Quette <[email protected]>
  • Loading branch information
aquette committed Jan 23, 2019
1 parent fbe13df commit f8244e5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/snmp-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -2744,7 +2744,7 @@ int su_setOID(int mode, const char *varname, const char *val)
*/
int daisychain_offset = 0;
if (devices_count > 1)
daisychain_offset = -1;
daisychain_offset = 1;

if (su_info_p->flags & SU_TYPE_DAISY_1) {
snprintf((char *)su_info_p->OID, SU_INFOSIZE, tmp_info_p->OID,
Expand Down

0 comments on commit f8244e5

Please sign in to comment.