[Scummvm-cvs-logs] SF.net SVN: scummvm:[52256] scummvm/trunk/engines/sci/engine/kfile.cpp
thebluegr at users.sourceforge.net
thebluegr at users.sourceforge.net
Sat Aug 21 15:03:36 CEST 2010
Revision: 52256
http://scummvm.svn.sourceforge.net/scummvm/?rev=52256&view=rev
Author: thebluegr
Date: 2010-08-21 13:03:35 +0000 (Sat, 21 Aug 2010)
Log Message:
-----------
SCI: Fixed potentially undefined behavior
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/kfile.cpp
Modified: scummvm/trunk/engines/sci/engine/kfile.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kfile.cpp 2010-08-21 11:34:19 UTC (rev 52255)
+++ scummvm/trunk/engines/sci/engine/kfile.cpp 2010-08-21 13:03:35 UTC (rev 52256)
@@ -954,14 +954,15 @@
FileHandle *f = getFileFromHandle(s, argv[0].toUint16());
if (!f)
return NULL_REG;
- return make_reg(0, (s->r_acc.toUint16() & 0xff00) | f->_in->readByte());
+ byte b = f->_in->readByte();
+ return make_reg(0, (s->r_acc.toUint16() & 0xff00) | b);
}
reg_t kFileIOWriteByte(EngineState *s, int argc, reg_t *argv) {
FileHandle *f = getFileFromHandle(s, argv[0].toUint16());
if (f)
f->_out->writeByte(argv[1].toUint16() & 0xff);
- return s->r_acc; // FIXME: does this really doesn't return anything?
+ return s->r_acc; // FIXME: does this really not return anything?
}
reg_t kFileIOReadWord(EngineState *s, int argc, reg_t *argv) {
@@ -975,7 +976,7 @@
FileHandle *f = getFileFromHandle(s, argv[0].toUint16());
if (f)
f->_out->writeUint16LE(argv[1].toUint16());
- return s->r_acc; // FIXME: does this really doesn't return anything?
+ return s->r_acc; // FIXME: does this really not return anything?
}
reg_t kCD(EngineState *s, int argc, reg_t *argv) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list