public: add Q_memfgets, replacement for COM_MemFgets rewritten using crtlib functions. Add a test

This commit is contained in:
Alibek Omarov
2026-03-01 03:04:33 +05:00
parent 53c5a33ffd
commit c19a824a42
8 changed files with 79 additions and 58 deletions

View File

@@ -776,7 +776,7 @@ void CL_InitClientMove( void )
clgame.pmove->COM_FileSize = COM_FileSize;
clgame.pmove->COM_LoadFile = COM_LoadFile;
clgame.pmove->COM_FreeFile = COM_FreeFile;
clgame.pmove->memfgets = COM_MemFgets;
clgame.pmove->memfgets = Q_memfgets;
clgame.pmove->PM_PlaySound = pfnPlaySound;
clgame.pmove->PM_TraceTexture = PM_CL_TraceTexture;
clgame.pmove->PM_PlaybackEventFull = pfnPlaybackEventFull;

View File

@@ -227,7 +227,7 @@ client_textmessage_t *CL_TextMessageParse( poolhandle_t mempool, byte *pMemFile,
lastLinePos = 0;
messageCount = 0;
while( COM_MemFgets( pMemFile, fileSize, &filePos, buf, 512 ) != NULL )
while( Q_memfgets( pMemFile, fileSize, &filePos, buf, 512 ) != NULL )
{
COM_TrimSpace( trim, buf, sizeof( trim ));