@@ -751,17 +751,16 @@ void ProcessEvent(WfxEvent_t inEvent)
751
751
scan = &scan_rsp.scan_info [x];
752
752
// clear structure and calculate size of SSID
753
753
memset (&ap, 0 , sizeof (ap));
754
- ap.ssid_length = strnlen ((char *) scan->ssid , chip::min<size_t >(sizeof (scan->ssid ), WFX_MAX_SSID_LENGTH));
755
- strncpy (ap.ssid , (char *) scan->ssid , ap.ssid_length );
756
- // assure null termination of scanned SSID
757
- ap.ssid [ap.ssid_length - 1 ] = 0 ;
754
+ ap.ssid_length =
755
+ strnlen (reinterpret_cast <char *>(scan->ssid ), chip::min<size_t >(sizeof (scan->ssid ), WFX_MAX_SSID_LENGTH));
756
+ chip::Platform::CopyString (ap.ssid , ap.ssid_length , reinterpret_cast <char *>(scan->ssid ));
758
757
759
758
// check if the scanned ssid is the one we are looking for
760
- if (wfx_rsi.scan_ssid_length != 0 && strcmp (wfx_rsi.scan_ssid , ap.ssid ) != CMP_SUCCESS)
759
+ if (wfx_rsi.scan_ssid_length != 0 && strncmp (wfx_rsi.scan_ssid , ap.ssid , WFX_MAX_SSID_LENGTH ) != CMP_SUCCESS)
761
760
{
762
761
continue ; // we found the targeted ssid.
763
762
}
764
- // TODO: Add support to convert security mode from RSI to WFX
763
+ // TODO: convert security mode from RSI to WFX
765
764
ap.security = static_cast <wfx_sec_t >(scan->security_mode );
766
765
ap.rssi = (-1 ) * scan->rssi_val ;
767
766
0 commit comments