mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 06:42:32 +08:00
Replace all sprintf with snprintf
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
committed by
Alin Jerpelea
parent
fa8719bb5a
commit
6f6fce95a2
@@ -63,7 +63,8 @@ const char *stm32_getchipid_string(void)
|
||||
|
||||
for (i = 0, c = 0; i < 12; i++)
|
||||
{
|
||||
sprintf(&cpuid[c], "%02X", getreg8(0x1ffff7e8 + 11 - i));
|
||||
snprintf(&cpuid[c], sizeof(cpuid) - c,
|
||||
"%02X", getreg8(0x1ffff7e8 + 11 - i));
|
||||
c += 2;
|
||||
if (i % 4 == 3)
|
||||
{
|
||||
|
||||
@@ -63,7 +63,8 @@ const char *stm32_getchipid_string(void)
|
||||
|
||||
for (i = 0, c = 0; i < 12; i++)
|
||||
{
|
||||
sprintf(&cpuid[c], "%02X", getreg8(0x1ffff7e8 + 11 - i));
|
||||
snprintf(&cpuid[c], sizeof(cpuid) - c,
|
||||
"%02X", getreg8(0x1ffff7e8 + 11 - i));
|
||||
c += 2;
|
||||
if (i % 4 == 3)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user