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>
return 0;
while ((dir = readdir(D)) != NULL) {
- char full_path[256];
+ char full_path[257];
if (!strcmp(dir->d_name, ".") || !strcmp(dir->d_name, ".."))
continue;