mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-29 04:20:20 +00:00
hfp: use btstack_min in hfp_gsm_set_clip [a2392]
This commit is contained in:
parent
c1ab6cc1be
commit
217914701a
@ -222,11 +222,11 @@ static int next_call_index(void){
|
||||
}
|
||||
|
||||
static void hfp_gsm_set_clip(int index_in_table, uint8_t type, const char * number){
|
||||
if (strlen(number) == 0) return;
|
||||
uint16_t number_str_len = (uint16_t) strlen(number);
|
||||
if (number_str_len == 0) return;
|
||||
|
||||
gsm_calls[index_in_table].clip_type = type;
|
||||
|
||||
int clip_number_size = (strlen(number) < HFP_GSM_MAX_CALL_NUMBER_SIZE) ? (int) strlen(number) : (HFP_GSM_MAX_CALL_NUMBER_SIZE-1);
|
||||
int clip_number_size = btstack_min(number_str_len, HFP_GSM_MAX_CALL_NUMBER_SIZE - 1);
|
||||
strncpy(gsm_calls[index_in_table].clip_number, number, clip_number_size);
|
||||
gsm_calls[index_in_table].clip_number[clip_number_size] = '\0';
|
||||
strncpy(last_dialed_number, number, clip_number_size);
|
||||
|
Loading…
x
Reference in New Issue
Block a user