Skip to content

Commit

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

* 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 andrei-menzopol committed Apr 14, 2022
1 parent 5385882 commit ea65629
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 ea65629

Please sign in to comment.