]> git.ipfire.org Git - thirdparty/asterisk.git/commit
main/say: Work around gcc 9 format-truncation false positive
authorWalter Doekes <walter+asterisk@wjd.nu>
Thu, 4 Jun 2020 14:23:37 +0000 (16:23 +0200)
committerWalter Doekes <walter+asterisk@wjd.nu>
Thu, 29 Oct 2020 13:18:48 +0000 (08:18 -0500)
commitfb3b14ab7db9026bca39f82931564350b401c557
treea17e62793a36488d2ad7192d51b37e7203f32ec8
parent439f7bb8485c08e2825e954158b8f8e898099ff9
main/say: Work around gcc 9 format-truncation false positive

Version: gcc (Ubuntu 9.3.0-10ubuntu2) 9.3.0
Warning:
  say.c:2371:24: error: ā€˜%d’ directive output may be truncated writing
    between 1 and 11 bytes into a region of size 10
    [-Werror=format-truncation=]
  2371 |     snprintf(buf, 10, "%d", num);
  say.c:2371:23: note: directive argument in the range [-2147483648, 9]

That's not possible though, as the if() starts out checking for (num < 0),
making this Warning a false positive.

(Also replaced some else<TAB>if with else<SP>if while in the vicinity.)

Change-Id: Ic7a70120188c9aa525a6d70289385bfce878438a
main/say.c