mirror of
https://github.com/rehlds/rehlds.git
synced 2025-03-13 14:00:26 +03:00
Merge branch 'dreamstalker:master' into test-overflowfix-szgetspace
This commit is contained in:
commit
b7c8365c35
@ -1995,6 +1995,9 @@ int EXT_FUNC COM_FileSize(const char *filename)
|
|||||||
|
|
||||||
unsigned char* EXT_FUNC COM_LoadFile(const char *path, int usehunk, int *pLength)
|
unsigned char* EXT_FUNC COM_LoadFile(const char *path, int usehunk, int *pLength)
|
||||||
{
|
{
|
||||||
|
if (!path || !path[0])
|
||||||
|
return NULL;
|
||||||
|
|
||||||
char base[MAX_PATH];
|
char base[MAX_PATH];
|
||||||
unsigned char *buf = NULL;
|
unsigned char *buf = NULL;
|
||||||
|
|
||||||
|
@ -461,7 +461,7 @@ static uchar16 *StripWhitespaceWorker(uchar16 *pwch, int cchLength, bool *pbStri
|
|||||||
// walk backwards from the end of the string, killing any whitespace
|
// walk backwards from the end of the string, killing any whitespace
|
||||||
*pbStrippedWhitespace = false;
|
*pbStrippedWhitespace = false;
|
||||||
|
|
||||||
uchar16 *pwchEnd = pwch + cchLength;
|
uchar16 *pwchEnd = pwch + cchLength - 1;
|
||||||
while (--pwchEnd >= pwch)
|
while (--pwchEnd >= pwch)
|
||||||
{
|
{
|
||||||
if (!iswspace(*pwchEnd) && !Q_IsMeanSpaceW(*pwchEnd))
|
if (!iswspace(*pwchEnd) && !Q_IsMeanSpaceW(*pwchEnd))
|
||||||
@ -505,7 +505,7 @@ uchar16 *__cdecl StripUnprintableWorker(uchar16 *pwch, int *pLength, bool *pStri
|
|||||||
*pStripped = rPos != wPos;
|
*pStripped = rPos != wPos;
|
||||||
|
|
||||||
if (*pStripped)
|
if (*pStripped)
|
||||||
*pLength = wPos - pwch;
|
*pLength = (wPos - pwch) + 1; // null termination
|
||||||
|
|
||||||
return pwch;
|
return pwch;
|
||||||
}
|
}
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
|
|
||||||
#include "maintypes.h"
|
#include "maintypes.h"
|
||||||
|
|
||||||
#define ZONE_DYNAMIC_SIZE 0x20000
|
#define ZONE_DYNAMIC_SIZE 0x200000
|
||||||
|
|
||||||
typedef struct memblock_s memblock_t;
|
typedef struct memblock_s memblock_t;
|
||||||
typedef struct memzone_s memzone_t;
|
typedef struct memzone_s memzone_t;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user