Missing `else` condition
ted-miller opened this issue · comments
A user has found a missing else
condition. This leads to an improper response to an unknown message type.
Isn't the actual consequence the else
will always be taken if receiveMsg->header.msgType != ROS_MSG_MOTO_SELECT_TOOL
?
So
motoman/motoman_driver/MotoPlus/SimpleMessage.c
Lines 160 to 162 in 7860ff5
will always be executed?
Without the "else" on line 153, all the preceeding code (line 138 to 152) is pointless because whatever is set in that code gets overwritten by line 161 and 162.
Yes. That is what I wrote.
But only if msgType != ROS_MSG_MOTO_SELECT_TOOL
.
Isn't the actual consequence the else will always be taken if receiveMsg->header.msgType != ROS_MSG_MOTO_SELECT_TOOL?
Yes, you're correct. Now that I think about it some more... this might explain some wireshark captures that I've seen in the past that had unexpected sequence-id's in the reply. (I don't remember for certain. But I think I've seen this and just ignored it.)
Closing as #550 was merged (replacement PR).