example/sdp_rfcomm_query: use btstack_strcpy

This commit is contained in:
Matthias Ringwald 2022-01-17 16:45:03 +01:00
parent c10fde09c0
commit 182f71a59e

View File

@ -104,8 +104,7 @@ static void store_found_service(const char * name, uint8_t port){
printf("APP: Service name: '%s', RFCOMM port %u\n", name, port);
if (service_index < NUM_SERVICES){
services[service_index].channel_nr = port;
strncpy(services[service_index].service_name, (char*) name, SDP_SERVICE_NAME_LEN);
services[service_index].service_name[SDP_SERVICE_NAME_LEN] = 0;
btstack_strcpy(services[service_index].service_name, SDP_SERVICE_NAME_LEN + 1, name);
service_index++;
} else {
printf("APP: list full - ignore\n");