Skip to content

Commit 779589a

Browse files
adabreutibzbarsky-apple
authored andcommitted
Resolve default countryCodeSize when not set on commissioner (#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 <bzbarsky@apple.com> Co-authored-by: Boris Zbarsky <bzbarsky@apple.com>
1 parent e46279c commit 779589a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/controller/CHIPDeviceController.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -1723,7 +1723,9 @@ void DeviceCommissioner::PerformCommissioningStep(DeviceProxy * proxy, Commissio
17231723
#endif
17241724
if (status != CHIP_NO_ERROR)
17251725
{
1726-
ChipLogError(Controller, "Unable to find country code, defaulting to XX");
1726+
actualCountryCodeSize = 2;
1727+
memset(countryCodeStr, 'X', actualCountryCodeSize);
1728+
ChipLogError(Controller, "Unable to find country code, defaulting to %s", countryCodeStr);
17271729
}
17281730
chip::CharSpan countryCode(countryCodeStr, actualCountryCodeSize);
17291731

0 commit comments

Comments
 (0)