cmdlft55xx : Fix buf overrun (gcc 10 error)

src/cmdlft55xx.c:2560:43: error: ‘ - (Unknown)’ directive output may be truncated writing 21 bytes into a region of size between 15 and 24 [-Werror=format-truncation=]
 2560 |             snprintf(retStr, sizeof(buf), "%u - " _RED_("(Unknown)"), id);
      |                                           ^~~~~~~
src/cmdlft55xx.c:2560:13: note: ‘snprintf’ output between 23 and 32 bytes into a destination of size 25
 2560 |             snprintf(retStr, sizeof(buf), "%u - " _RED_("(Unknown)"), id);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This commit is contained in:
Philippe Teuwen 2020-05-11 13:58:38 +02:00
commit b377ca763a

View file

@ -2538,7 +2538,7 @@ bool AcquireData(uint8_t page, uint8_t block, bool pwdmode, uint32_t password, u
} }
char *GetPskCfStr(uint32_t id, bool q5) { char *GetPskCfStr(uint32_t id, bool q5) {
static char buf[25]; static char buf[40];
char *retStr = buf; char *retStr = buf;
switch (id) { switch (id) {
case 0: case 0: