Fix string copy compilation warnings
[fio.git] / filesetup.c
index 24e6fb0757d84d3ceafb21a18cd12b5016af8307..17fa31fb3cd48924be886d55569b7c1356e72faf 100644 (file)
@@ -829,7 +829,8 @@ static unsigned long long get_fs_free_counts(struct thread_data *td)
                        continue;
 
                fm = calloc(1, sizeof(*fm));
-               strncpy(fm->__base, buf, sizeof(fm->__base) - 1);
+               strncpy(fm->__base, buf, sizeof(fm->__base));
+               fm->__base[255] = '\0'; 
                fm->base = basename(fm->__base);
                fm->key = sb.st_dev;
                flist_add(&fm->list, &list);