[Scummvm-cvs-logs] CVS: scummvm/sword2 save_rest.cpp,1.74.2.1,1.74.2.2

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sat Nov 5 06:27:25 CET 2005


Update of /cvsroot/scummvm/scummvm/sword2
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26447/sword2

Modified Files:
      Tag: branch-0-8-0
	save_rest.cpp 
Log Message:
Call flush() after saving in SAGA, Simon and Broken Sword 2. (Backport from
trunk.)


Index: save_rest.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/sword2/save_rest.cpp,v
retrieving revision 1.74.2.1
retrieving revision 1.74.2.2
diff -u -d -r1.74.2.1 -r1.74.2.2
--- save_rest.cpp	18 Oct 2005 02:11:27 -0000	1.74.2.1
+++ save_rest.cpp	5 Nov 2005 14:26:50 -0000	1.74.2.2
@@ -189,13 +189,15 @@
 		return SR_ERR_FILEOPEN;
 	}
 
-	uint32 itemsWritten = out->write(buffer, bufferSize);
-
-	delete out;
+	out->write(buffer, bufferSize);
+	out->flush();
 
-	if (itemsWritten == bufferSize)
+	if (!out->ioFailed()) {
+		delete out;
 		return SR_OK;
+	}
 
+	delete out;
 	return SR_ERR_WRITEFAIL;
 }
 





More information about the Scummvm-git-logs mailing list