[riot-commits] [RIOT-OS/RIOT] 556d06: tests/gnrc_netif: Fix -Wformat-overflow

Martine Lenders authmillenon at gmail.com
Sat Aug 11 17:50:51 CEST 2018


  Branch: refs/heads/master
  Home:   https://github.com/RIOT-OS/RIOT
  Commit: 556d06d3bf19f358abfb0eb8e39b0cfca9007f97
      https://github.com/RIOT-OS/RIOT/commit/556d06d3bf19f358abfb0eb8e39b0cfca9007f97
  Author: Joakim NohlgÄrd <joakim.nohlgard at eistec.se>
  Date:   2018-08-11 (Sat, 11 Aug 2018)

  Changed paths:
    M tests/gnrc_netif/main.c

  Log Message:
  -----------
  tests/gnrc_netif: Fix -Wformat-overflow

Fixes the following error with GCC 7

main.c: In function 'test_netif_get_name':
main.c:1054:23: error: 'sprintf' may write a terminating nul past the end of the destination [-Werror=format-overflow=]
     sprintf(exp_name, "if%d", (int)netif);
                 ^~~~~~
main.c:1054:5: note: 'sprintf' output between 4 and 9 bytes into a destination of size 8
     sprintf(exp_name, "if%d", (int)netif);
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


  Commit: 6b0c34fa6f5568d04cd19da306b3ed28f3a6323a
      https://github.com/RIOT-OS/RIOT/commit/6b0c34fa6f5568d04cd19da306b3ed28f3a6323a
  Author: Martine Lenders <authmillenon at gmail.com>
  Date:   2018-08-11 (Sat, 11 Aug 2018)

  Changed paths:
    M tests/gnrc_netif/main.c

  Log Message:
  -----------
  Merge pull request #9765 from gebart/pr/sprintf-len

tests/gnrc_netif: Fix -Wformat-overflow


Compare: https://github.com/RIOT-OS/RIOT/compare/67e3b3a8ddcd...6b0c34fa6f55
      **NOTE:** This service has been marked for deprecation: https://developer.github.com/changes/2018-04-25-github-services-deprecation/

      Functionality will be removed from GitHub.com on January 31st, 2019.


More information about the commits mailing list