Use io_read_all to load icon font

This commit is contained in:
Robert Müller 2022-06-14 20:52:05 +02:00
parent 74d7d4fe78
commit ceca44ea23

View file

@ -699,11 +699,11 @@ public:
IOHANDLE File = pStorage->OpenFile(pFontFile, IOFLAG_READ, IStorage::TYPE_ALL, aFilename, sizeof(aFilename));
if(File)
{
size_t Size = io_length(File);
unsigned char *pBuf = (unsigned char *)malloc(Size);
io_read(File, pBuf, Size);
void *pBuf;
unsigned Size;
io_read_all(File, &pBuf, &Size);
io_close(File);
LoadFont(aFilename, pBuf, Size);
LoadFont(aFilename, (unsigned char *)pBuf, Size);
}
}