From ceca44ea2367f6dd70872e8073eb4f2b7eace46d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20M=C3=BCller?= Date: Tue, 14 Jun 2022 20:52:05 +0200 Subject: [PATCH] Use `io_read_all` to load icon font --- src/engine/client/text.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/engine/client/text.cpp b/src/engine/client/text.cpp index 2a21609f2..6a8a7ef7b 100644 --- a/src/engine/client/text.cpp +++ b/src/engine/client/text.cpp @@ -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); } }