- memset(fname, 0, sizeof(fname));
- if (aux_path)
- sprintf(fname, "%s%s", aux_path, FIO_OS_PATH_SEPARATOR);
-
- strncpy(fname + strlen(fname), basename(ptr), buf_left - 1);
-
- buf_left -= strlen(fname);
- if (buf_left <= 0) {
- if (!dump_buf_warned) {
- log_err("fio: verify failure dump buffer too small\n");
- dump_buf_warned = 1;
- }
- free(ptr);
- return;
+ if (asprintf(&fname, "%s%s%s.%llu.%s", aux_path ? : "",
+ aux_path ? sep : "", basename(ptr), offset, type) < 0) {
+ if (!fio_did_warn(FIO_WARN_VERIFY_BUF))
+ log_err("fio: not enough memory for dump buffer filename\n");
+ goto free_ptr;