X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=diskutil.c;h=cb285cffb31d3137421518dbba6c5c42e14e1bbf;hb=4904acd5c4ca5b4940fe198275c2afd339e623b8;hp=3ee5c6c871b4d4545ff0f9f34b0a4ef81e89e234;hpb=9edf7b3ed581a61433ad620d457b4d0349115e52;p=fio.git diff --git a/diskutil.c b/diskutil.c index 3ee5c6c8..cb285cff 100644 --- a/diskutil.c +++ b/diskutil.c @@ -300,7 +300,7 @@ static struct disk_util *disk_util_add(struct thread_data *td, int majdev, sfree(du); return NULL; } - strncpy((char *) du->dus.name, basename(path) - 1, FIO_DU_NAME_SZ); + strncpy((char *) du->dus.name, basename(path), FIO_DU_NAME_SZ - 1); du->sysfs_root = path; du->major = majdev; du->minor = mindev;