]> 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)
committerFriendly Automation <jenkins2@gerrit.asterisk.org>
Fri, 30 Oct 2020 12:26:19 +0000 (07:26 -0500)
commitbee2e3e720e1d95094487744ac783292c6328416
tree25678e996f7fb76a86bd06ea84e1a2c24e05d186
parentca8f0b1d21b9c46ebfaf980ba9bf35d6b5339b8a
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