virt plugin: fix truncation warning
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 15 May 2018 19:20:24 +0000 (21:20 +0200)
committerRuben Kerkhof <ruben@rubenkerkhof.com>
Tue, 15 May 2018 19:54:35 +0000 (21:54 +0200)
commit1edb3b9f2c98067d26a0ec47246650a09a026b23
tree98ce5a9303d66f780a54da048b9ae5848305182e
parenta3dd3831138a4167ceb8782a63ef123832e8bfba
virt plugin: fix truncation warning

src/virt.c: In function ‘refresh_lists’:
src/virt.c:2123:61: warning: ‘%u’ directive output may be truncated writing between 1 and 10 bytes into a region of size 5 [-Wformat-truncation=]
   snprintf(number_string, sizeof(number_string), "interface-%u", number);
                                                             ^~
src/virt.c:2123:50: note: directive argument in the range [1, 2147483647]
   snprintf(number_string, sizeof(number_string), "interface-%u", number);
                                                  ^~~~~~~~~~~~~~
src/virt.c:2123:3: note: ‘snprintf’ output between 12 and 21 bytes into a destination of size 15
   snprintf(number_string, sizeof(number_string), "interface-%u", number);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/virt.c