diff --git a/engines/bagel/baglib/help.cpp b/engines/bagel/baglib/help.cpp index 8ecc2264ce7..0ebc58f7e88 100644 --- a/engines/bagel/baglib/help.cpp +++ b/engines/bagel/baglib/help.cpp @@ -121,7 +121,7 @@ ErrorCode CBagHelp::attach() { CBofFile file(_textFile, CBF_BINARY | CBF_READONLY); uint32 size = file.getLength(); - char *buffer = (char *)bofCAlloc(size + 1, 1); + char *buffer = (char *)bofCleanAlloc(size + 1); file.read(buffer, size); diff --git a/engines/bagel/baglib/text_object.cpp b/engines/bagel/baglib/text_object.cpp index d416e52bca5..53e1d107715 100644 --- a/engines/bagel/baglib/text_object.cpp +++ b/engines/bagel/baglib/text_object.cpp @@ -141,7 +141,7 @@ ErrorCode CBagTextObject::attach() { if (!fpTextFile.errorOccurred()) { // Allocate the buffers uint32 nFileLen = fpTextFile.getLength(); - char *pTextBuff = (char *)bofCAlloc(nFileLen + 1, 1); + char *pTextBuff = (char *)bofCleanAlloc(nFileLen + 1); // Read the text file into buffers fpTextFile.read(pTextBuff, nFileLen); diff --git a/engines/bagel/boflib/misc.h b/engines/bagel/boflib/misc.h index c52135a9320..c751e4cdd59 100644 --- a/engines/bagel/boflib/misc.h +++ b/engines/bagel/boflib/misc.h @@ -81,7 +81,7 @@ extern void *bofMemAlloc(uint32 nSize, const char *pFile, int nLine, bool bClear extern void bofMemFree(void *pBuf); #define bofAlloc(n) bofMemAlloc((n), __FILE__, __LINE__, false) -#define bofCAlloc(n, m) bofMemAlloc((uint32)(n) * (m), __FILE__, __LINE__, true) +#define bofCleanAlloc(n) bofMemAlloc((n), __FILE__, __LINE__, true) #define bofFree(p) bofMemFree((p)) inline uint32 getFreePhysMem() { diff --git a/engines/bagel/dialogs/credits_dialog.cpp b/engines/bagel/dialogs/credits_dialog.cpp index ecf34a966fa..7318113b4a4 100644 --- a/engines/bagel/dialogs/credits_dialog.cpp +++ b/engines/bagel/dialogs/credits_dialog.cpp @@ -141,7 +141,7 @@ ErrorCode CBagCreditsDialog::loadNextTextFile() { if (!cFile.errorOccurred()) { // Read in text file uint32 lSize = cFile.getLength(); - _pszText = (char *)bofCAlloc(lSize + 1, 1); + _pszText = (char *)bofCleanAlloc(lSize + 1); cFile.read(_pszText, lSize);