projects
/
fio.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
disk util: fix bug in strncpy() conversion
[fio.git]
/
backend.c
diff --git
a/backend.c
b/backend.c
index c1c8f96774850a755681dffa710d0ee1550fe16b..62bca29194ed08a80af9c68afdc1fbda75b164ef 100644
(file)
--- a/
backend.c
+++ b/
backend.c
@@
-1114,13
+1114,14
@@
static int switch_ioscheduler(struct thread_data *td)
/*
* Read back and check that the selected scheduler is now the default.
*/
/*
* Read back and check that the selected scheduler is now the default.
*/
- memset(tmp, 0, sizeof(tmp));
- ret = fread(tmp, 1, sizeof(tmp) - 1, f);
+ ret = fread(tmp, sizeof(tmp), 1, f);
if (ferror(f) || ret < 0) {
td_verror(td, errno, "fread");
fclose(f);
return 1;
}
if (ferror(f) || ret < 0) {
td_verror(td, errno, "fread");
fclose(f);
return 1;
}
+ tmp[sizeof(tmp) - 1] = '\0';
+
sprintf(tmp2, "[%s]", td->o.ioscheduler);
if (!strstr(tmp, tmp2)) {
sprintf(tmp2, "[%s]", td->o.ioscheduler);
if (!strstr(tmp, tmp2)) {