Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
static void dump_buf(char *buf, unsigned int len, unsigned long long offset,
const char *type, struct fio_file *f)
{
static void dump_buf(char *buf, unsigned int len, unsigned long long offset,
const char *type, struct fio_file *f)
{
- strcpy(fname, f->file_name);
- basename(fname);
+ ptr = strdup(f->file_name);
+ strcpy(fname, basename(ptr));
sprintf(fname + strlen(fname), ".%llu.%s", offset, type);
sprintf(fname + strlen(fname), ".%llu.%s", offset, type);
close(fd);
log_err(" %s data dumped as %s\n", type, fname);
close(fd);
log_err(" %s data dumped as %s\n", type, fname);