Skip to content

Commit

Permalink
atcmd.c:fix a couple warnings [-Wformat-overflow=]
Browse files Browse the repository at this point in the history
  • Loading branch information
andy5995 committed Jul 14, 2021
1 parent d13e0de commit 49efcb7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/atcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ prPercent (Atcmd * atcmdp)
{
char buf[64];

sprintf (buf, "%c%c%%B0=%d %%B1=%d %%D%d %%L%d %%R%d",
snprintf (buf, sizeof buf, "%c%c%%B0=%d %%B1=%d %%D%d %%L%d %%R%d",
CHAR_CR, CHAR_LF,
atcmdp->pb[0], atcmdp->pb[1], atcmdp->pd, atcmdp->pl, atcmdp->pr);
putTtyN (buf, strlen (buf));
Expand Down Expand Up @@ -172,7 +172,7 @@ prSreg (uchar * s)
}
else
putTtyStr (" ");
sprintf (buf, "S%02d=%03d", i, *s);
snprintf (buf, sizeof buf, "S%02d=%03d", i, *s);
putTtyN (buf, 7);
}
}
Expand Down

0 comments on commit 49efcb7

Please sign in to comment.