Skip to content
Snippets Groups Projects
  • Joakim Nohlgård's avatar
    556d06d3
    tests/gnrc_netif: Fix -Wformat-overflow · 556d06d3
    Joakim Nohlgård authored
    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);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    556d06d3
    History
    tests/gnrc_netif: Fix -Wformat-overflow
    Joakim Nohlgård authored
    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);
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~