Skip to content

Commit

Permalink
HOPKINS: Added explicit clearing of allocated buffers in BOITE
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Oct 24, 2012
1 parent 7441e0e commit afadf60
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions engines/hopkins/font.cpp
Expand Up @@ -118,18 +118,18 @@ void FontManager::BOITE(int idx, int messageId, const Common::String &filename,
byte *v9;
const byte *v10;
int v11;
char v13;
char v14;
byte v13;
byte v14;
int v15;
char v16;
byte v16;
int v17;
int v18;
int v19;
int v20;
int v21;
int v22;
int v23;
char v24;
byte v24;
int v25;
int v27;
int v28;
Expand Down Expand Up @@ -235,13 +235,16 @@ void FontManager::BOITE(int idx, int messageId, const Common::String &filename,
if (texte_tmp == g_PTRNUL)
error("Error allocating text");

Common::fill(&texte_tmp[0], &texte_tmp[0x80a], 0);
f.read(texte_tmp, 0x800u);
f.close();
_vm->_globals.texte_long = 2048;
} else {
v69 = 100;
_vm->_globals.texte_long = 100;
v9 = _vm->_globals.dos_malloc2(0x6Eu);
Common::fill(&v9[0], &v9[0x6e], 0);

texte_tmp = v9;
v10 = _vm->_globals.BUF_ZONE + Index[messageId];
memcpy(v9, v10, 0x60u);
Expand Down

0 comments on commit afadf60

Please sign in to comment.