mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-15 21:40:22 +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;
|