2015-03-23 Fred Gleason <fredg@paravelsystems.com>

* Fixed a fencepost bug in 'ripcd/sasusi.cpp' that caused the
	last relay in the list to fail to respond to a 'GO' RML.
This commit is contained in:
Fred Gleason 2015-03-23 17:05:28 -04:00
parent 032f7f0f5a
commit 19c5ce9364
2 changed files with 5 additions and 1 deletions

View File

@ -14837,3 +14837,6 @@
2015-03-16 Fred Gleason <fredg@paravelsystems.com>
* Added 'DESCRIPTION', 'OUTCUE', 'FILENAME' and '*_POINT' fields
to the 'Cart CSV Report' in 'rdlibrary/list_reports.cpp'.
2015-03-23 Fred Gleason <fredg@paravelsystems.com>
* Fixed a fencepost bug in 'ripcd/sasusi.cpp' that caused the
last relay in the list to fail to respond to a 'GO' RML.

View File

@ -288,10 +288,11 @@ void SasUsi::processCommand(RDMacro *cmd)
}
cmd_byte=0x01;
}
if(cmd->arg(2).toUInt()<sas_relay_numbers.size()) {
if(cmd->arg(2).toUInt()<=sas_relay_numbers.size()) {
if(sas_relay_numbers[cmd->arg(2).toUInt()-1]>=0) {
snprintf(str,256,"\x05R%d%04d\x0D\x0A",cmd_byte,
sas_relay_numbers[cmd->arg(2).toUInt()-1]);
syslog(LOG_NOTICE,"USI: %s",(const char *)PrettifyCommand(str));
SendCommand(str);
cmd->acknowledge(true);
emit rmlEcho(cmd);