]> granicus.if.org Git - sysstat/commit
iostat.c: Fix gcc format-truncation warning
authorSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 20 Jul 2018 07:38:38 +0000 (09:38 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 20 Jul 2018 07:38:38 +0000 (09:38 +0200)
commit056b72c49992dd4552b3027e105e3ef52a81ca3e
tree94e2bcd89ed843f1ccd0b826164a269d12fc940d
parent3e406e0eb149eb516c274e72e757617d745dda3c
iostat.c: Fix gcc format-truncation warning

Resize buffers to avoid warnings from gcc:

iostat.c: In function ‘read_sysfs_dlist_part_stat’:
iostat.c:576:39: warning: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size between 0 and 1023 [-Wformat-truncation=]
   snprintf(filename, MAX_PF_NAME, "%s/%s/%s", dfile, drd->d_name, S_STAT);
                                       ^~
iostat.c:576:3: note: ‘snprintf’ output between 7 and 1285 bytes into a destination of size 1024
   snprintf(filename, MAX_PF_NAME, "%s/%s/%s", dfile, drd->d_name, S_STAT);
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
iostat.c