Fix assert when saving snapshots beyond the first.

This commit is contained in:
Aaron Giles 2011-02-13 21:30:40 +00:00
parent 9ff458e52f
commit 5140c0e6a0

View File

@ -1202,13 +1202,13 @@ file_error video_manager::open_next(emu_file &file, const char *extension)
{ {
// try until we succeed // try until we succeed
astring seqtext; astring seqtext;
file.set_openflags(OPEN_FLAG_READ);
for (int seq = 0; ; seq++) for (int seq = 0; ; seq++)
{ {
// build up the filename // build up the filename
fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d", seq).cstr()); fname.cpy(snapstr).replace(0, "%i", seqtext.format("%04d", seq).cstr());
// try to open the file; stop when we fail // try to open the file; stop when we fail
file.set_openflags(OPEN_FLAG_READ);
file_error filerr = file.open(fname); file_error filerr = file.open(fname);
if (filerr != FILERR_NONE) if (filerr != FILERR_NONE)
break; break;