mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-13 21:31:53 +00:00
DRASCULA: Fix some code analysis warnings (bug #3087830)
svn-id: r53473
This commit is contained in:
parent
b0923dfd76
commit
9b9e8f7d8d
@ -92,13 +92,19 @@ void TextResourceParser::getLine(char *buf) {
|
||||
void TextResourceParser::parseInt(int &result) {
|
||||
char buf[256];
|
||||
getLine(buf);
|
||||
sscanf(buf, "%d", &result);
|
||||
|
||||
if (!sscanf(buf, "%d", &result)) {
|
||||
result = 0;
|
||||
}
|
||||
}
|
||||
|
||||
void TextResourceParser::parseString(char* result) {
|
||||
char buf[256];
|
||||
getLine(buf);
|
||||
sscanf(buf, "%s", result);
|
||||
|
||||
if (!sscanf(buf, "%s", result)) {
|
||||
*result = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1945,7 +1945,9 @@ bool DrasculaEngine::exitRoom(int doorNumber) {
|
||||
hare_se_ve = 1;
|
||||
|
||||
clearRoom();
|
||||
sscanf(_targetSurface[doorNumber], "%d", &roomNum);
|
||||
if (!sscanf(_targetSurface[doorNumber], "%d", &roomNum)) {
|
||||
error("Malformed roomNum in targetSurface (%s)", _targetSurface[doorNumber]);
|
||||
}
|
||||
curX = -1;
|
||||
enterRoom(roomNum);
|
||||
|
||||
|
@ -221,7 +221,9 @@ bool DrasculaEngine::loadGame(const char *gameName) {
|
||||
takeObject = sav->readSint32LE();
|
||||
pickedObject = sav->readSint32LE();
|
||||
loadedDifferentChapter = 0;
|
||||
sscanf(currentData, "%d.ald", &roomNum);
|
||||
if (!sscanf(currentData, "%d.ald", &roomNum)) {
|
||||
error("Bad save format");
|
||||
}
|
||||
enterRoom(roomNum);
|
||||
selectVerb(kVerbNone);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user