mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-03-28 08:37:22 +00:00
example: use snprintf
This commit is contained in:
parent
f89e874b33
commit
db2353e526
@ -94,8 +94,8 @@ static uint16_t pbap_cid;
|
||||
static int sim1_selected;
|
||||
|
||||
static void refresh_phonebook_folder_and_path(void){
|
||||
sprintf(phonebook_path, "%s%s.vcf", sim1_selected ? "SIM1/telecom/" : "telecom/", phonebook_name);
|
||||
sprintf(phonebook_folder, "%s%s", sim1_selected ? "SIM1/telecom/" : "telecom/", phonebook_name);
|
||||
snprintf(phonebook_path, sizeof(phonebook_path), "%s%s.vcf", sim1_selected ? "SIM1/telecom/" : "telecom/", phonebook_name);
|
||||
snprintf(phonebook_folder, sizeof(phonebook_folder), "%s%s", sim1_selected ? "SIM1/telecom/" : "telecom/", phonebook_name);
|
||||
printf("[-] Phonebook folder '%s'\n", phonebook_folder);
|
||||
printf("[-] Phonebook path '%s'\n", phonebook_path);
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ static int att_write_callback(hci_con_handle_t con_handle, uint16_t att_handle,
|
||||
|
||||
static void beat(void){
|
||||
counter++;
|
||||
counter_string_len = sprintf(counter_string, "BTstack counter %04u", counter);
|
||||
counter_string_len = snprintf(counter_string, sizeof(counter_string), "BTstack counter %04u", counter);
|
||||
puts(counter_string);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user