Skip to content

Commit

Permalink
Resolve default countryCodeSize when not set on commissioner (#16724)
Browse files Browse the repository at this point in the history
* Resolve default countryCodeSize when not set on commissioner

* Re-initialize countrycodestr on failure

* Generalize print

* Update src/controller/CHIPDeviceController.cpp

Co-authored-by: Boris Zbarsky <[email protected]>

Co-authored-by: Boris Zbarsky <[email protected]>
  • Loading branch information
2 people authored and pull[bot] committed Apr 5, 2022
1 parent 727dbef commit 1030904
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/controller/CHIPDeviceController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,9 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio
#endif
if (status != CHIP_NO_ERROR)
{
ChipLogError(Controller, "Unable to find country code, defaulting to XX");
actualCountryCodeSize = 2;
memset(countryCodeStr, 'X', actualCountryCodeSize);
ChipLogError(Controller, "Unable to find country code, defaulting to %s", countryCodeStr);
}
chip::CharSpan countryCode(countryCodeStr, actualCountryCodeSize);

Expand Down

0 comments on commit 1030904

Please sign in to comment.