Skip to content

Commit

Permalink
Fix handling of > 32 bit ints in struct/lists in chip-tool. (#15371)
Browse files Browse the repository at this point in the history
The CanCastTo checks were using the right getter, but the actual casts
were using one that only works for 32-bit ints.

Fixes #15360
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Mar 1, 2022
1 parent 8c63796 commit 3984040
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/chip-tool/commands/clusters/ComplexArgument.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class ComplexArgumentParser
return CHIP_ERROR_INVALID_ARGUMENT;
}

request = static_cast<T>(value.asUInt());
request = static_cast<T>(value.asLargestUInt());
return CHIP_NO_ERROR;
}

Expand All @@ -58,7 +58,7 @@ class ComplexArgumentParser
return CHIP_ERROR_INVALID_ARGUMENT;
}

request = static_cast<T>(value.asInt());
request = static_cast<T>(value.asLargestInt());
return CHIP_NO_ERROR;
}

Expand Down

0 comments on commit 3984040

Please sign in to comment.