#include "lib/rand.h"
#include "lib/hweight.h"
#include "lib/pattern.h"
+#include "oslib/asprintf.h"
#include "crc/md5.h"
#include "crc/crc64.h"
fill_hdr(td, io_u, hdr, header_num, header_len, io_u->rand_seed);
+ if (header_len <= hdr_size(td, hdr)) {
+ td_verror(td, EINVAL, "Blocksize too small");
+ return;
+ }
data_len = header_len - hdr_size(td, hdr);
data = p + hdr_size(td, hdr);
s->rand.state32.s[3] = 0;
s->rand.use64 = 0;
}
- s->name[sizeof(s->name) - 1] = '\0';
- strncpy((char *) s->name, td->o.name, sizeof(s->name) - 1);
+ snprintf((char *) s->name, sizeof(s->name), "%s", td->o.name);
next = io_list_next(s);
}