mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-01-03 23:47:08 +00:00
9 lines
246 B
Plaintext
9 lines
246 B
Plaintext
// Replace sprintf with snprintf and assert trailing '\0'
|
|
@@
|
|
expression buffer, formatstring;
|
|
expression list args;
|
|
@@
|
|
- sprintf(buffer, formatstring, args);
|
|
+ snprintf(buffer, sizeof(buffer), formatstring, args);
|
|
+ buffer[sizeof(buffer)-1] = 0;
|