Skip to content

Commit

Permalink
check if getParam data length matches with expected length
Browse files Browse the repository at this point in the history
Signed-off-by: Daisuke Sato <[email protected]>
  • Loading branch information
daisukes committed Sep 14, 2024
1 parent 600554d commit ff9c452
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CaBotHandle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,8 @@ bool Handle::getParam(const char * name, int * out, size_t num, int timeout_ms)
}
}
}
if (read_count == 0) {
// cannot find parameter
if (read_count == 0 || read_count != num) {
// cannot find parameter or got wrong parameter (due to com issue)
return false;
}
for (size_t i = 0; i < num; i++) {
Expand Down

0 comments on commit ff9c452

Please sign in to comment.