projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
eta: use struct jobs_eta_packed
[fio.git]
/
filesetup.c
diff --git
a/filesetup.c
b/filesetup.c
index 17fa31fb3cd48924be886d55569b7c1356e72faf..57eca1bf5bf06f013c4c89e7ee553e440d9e15c3 100644
(file)
--- a/
filesetup.c
+++ b/
filesetup.c
@@
-805,8
+805,7
@@
static unsigned long long get_fs_free_counts(struct thread_data *td)
} else if (f->filetype != FIO_TYPE_FILE)
continue;
} else if (f->filetype != FIO_TYPE_FILE)
continue;
- buf[255] = '\0';
- strncpy(buf, f->file_name, 255);
+ snprintf(buf, ARRAY_SIZE(buf), "%s", f->file_name);
if (stat(buf, &sb) < 0) {
if (errno != ENOENT)
if (stat(buf, &sb) < 0) {
if (errno != ENOENT)
@@
-829,8
+828,7
@@
static unsigned long long get_fs_free_counts(struct thread_data *td)
continue;
fm = calloc(1, sizeof(*fm));
continue;
fm = calloc(1, sizeof(*fm));
- strncpy(fm->__base, buf, sizeof(fm->__base));
- fm->__base[255] = '\0';
+ snprintf(fm->__base, ARRAY_SIZE(fm->__base), "%s", buf);
fm->base = basename(fm->__base);
fm->key = sb.st_dev;
flist_add(&fm->list, &list);
fm->base = basename(fm->__base);
fm->key = sb.st_dev;
flist_add(&fm->list, &list);