With newlib_libc enabled, a warning was printed for this sprintf.
The settings_name may expand to 17 characters instead of the available
15.
Fixes#808.
Full warning:
[49/272] Building C object CMakeFiles/app.dir/src/ble.c.obj
In file included from /home/okke/.local/zephyr-sdk-0.11.2/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:800,
from ../../src/ble.c:12:
../../src/ble.c: In function 'set_profile_address':
../../src/ble.c:118:27: warning: '%d' directive writing between 1 and 3 bytes into a region of size 2 [-Wformat-overflow=]
118 | sprintf(setting_name, "ble/profiles/%d", index);
| ^~~~~~~~~~~~~~~~~
../../src/ble.c:118:41: note: format string is defined here
118 | sprintf(setting_name, "ble/profiles/%d", index);
| ^~
In file included from /home/okke/.local/zephyr-sdk-0.11.2/arm-zephyr-eabi/arm-zephyr-eabi/sys-include/stdio.h:800,
from ../../src/ble.c:12:
../../src/ble.c:118:27: note: directive argument in the range [0, 255]
118 | sprintf(setting_name, "ble/profiles/%d", index);
| ^~~~~~~~~~~~~~~~~
../../src/ble.c:118:5: note: '__builtin___sprintf_chk' output between 15 and 17 bytes into a destination of size 15
118 | sprintf(setting_name, "ble/profiles/%d", index);
| ^~~~~~~