diskutil: ensure we have enough room to not write past end
authorJens Axboe <axboe@kernel.dk>
Wed, 7 Jun 2017 16:45:46 +0000 (10:45 -0600)
committerJens Axboe <axboe@kernel.dk>
Wed, 7 Jun 2017 16:45:46 +0000 (10:45 -0600)
commit5ccdfd74e2e13c61eec307e53a50f3f73f0afe7a
treed0383c03dd43367c2879809fe9581a1887600b3b
parent872e0415ed05ad5bf639c990da224447cadf58b3
diskutil: ensure we have enough room to not write past end

gcc 7.1 triggers this warning:

diskutil.c: In function ‘find_block_dir’:
diskutil.c:371:22: warning: ‘__builtin___sprintf_chk’ may write a terminating nul past the end of the destination [-Wformat-overflow=]
   sprintf(full_path, "%s/%s", path, dir->d_name);
                      ^~~~~~~
In file included from /usr/include/stdio.h:936:0,
                 from diskutil.c:1:

Ensure that it's 256+1 in length.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
diskutil.c