1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-01 01:25:55 +00:00

Fixing array sizes in CMessages

This commit is contained in:
Sergeanur 2019-10-25 22:44:00 +03:00
parent 17441c972b
commit ccf9c53049

View file

@ -118,7 +118,7 @@ CMessages::Process()
void void
CMessages::Display() CMessages::Display()
{ {
wchar outstr[260]; wchar outstr[256];
DefinedState(); DefinedState();
@ -154,7 +154,7 @@ CMessages::Display()
void void
CMessages::AddMessage(wchar *msg, uint32 time, uint16 flag) CMessages::AddMessage(wchar *msg, uint32 time, uint16 flag)
{ {
wchar outstr[514]; // unused wchar outstr[512]; // unused
WideStringCopy(outstr, msg, 256); WideStringCopy(outstr, msg, 256);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
GetWideStringLength(outstr); GetWideStringLength(outstr);
@ -190,7 +190,7 @@ CMessages::AddMessage(wchar *msg, uint32 time, uint16 flag)
void void
CMessages::AddMessageJumpQ(wchar *msg, uint32 time, uint16 flag) CMessages::AddMessageJumpQ(wchar *msg, uint32 time, uint16 flag)
{ {
wchar outstr[514]; // unused wchar outstr[512]; // unused
WideStringCopy(outstr, msg, 256); WideStringCopy(outstr, msg, 256);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
GetWideStringLength(outstr); GetWideStringLength(outstr);
@ -212,7 +212,7 @@ CMessages::AddMessageJumpQ(wchar *msg, uint32 time, uint16 flag)
void void
CMessages::AddMessageSoon(wchar *msg, uint32 time, uint16 flag) CMessages::AddMessageSoon(wchar *msg, uint32 time, uint16 flag)
{ {
wchar outstr[520]; // unused wchar outstr[512]; // unused
WideStringCopy(outstr, msg, 256); WideStringCopy(outstr, msg, 256);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
GetWideStringLength(outstr); GetWideStringLength(outstr);
@ -272,7 +272,7 @@ CMessages::ClearSmallMessagesOnly()
void void
CMessages::AddBigMessage(wchar *msg, uint32 time, uint16 style) CMessages::AddBigMessage(wchar *msg, uint32 time, uint16 style)
{ {
wchar outstr[514]; // unused wchar outstr[512]; // unused
WideStringCopy(outstr, msg, 256); WideStringCopy(outstr, msg, 256);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
GetWideStringLength(outstr); GetWideStringLength(outstr);
@ -292,7 +292,7 @@ CMessages::AddBigMessage(wchar *msg, uint32 time, uint16 style)
void void
CMessages::AddBigMessageQ(wchar *msg, uint32 time, uint16 style) CMessages::AddBigMessageQ(wchar *msg, uint32 time, uint16 style)
{ {
wchar outstr[518]; // unused wchar outstr[512]; // unused
WideStringCopy(outstr, msg, 256); WideStringCopy(outstr, msg, 256);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
GetWideStringLength(outstr); GetWideStringLength(outstr);
@ -358,8 +358,8 @@ CMessages::AddToPreviousBriefArray(wchar *text, int32 n1, int32 n2, int32 n3, in
void void
CMessages::InsertNumberInString(wchar *str, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6, wchar *outstr) CMessages::InsertNumberInString(wchar *str, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6, wchar *outstr)
{ {
char numStr[12]; char numStr[10];
wchar wNumStr[18]; wchar wNumStr[10];
if (str == nil) { if (str == nil) {
*outstr = '\0'; *outstr = '\0';
@ -398,7 +398,7 @@ CMessages::InsertNumberInString(wchar *str, int32 n1, int32 n2, int32 n3, int32
void void
CMessages::InsertStringInString(wchar *str1, wchar *str2) CMessages::InsertStringInString(wchar *str1, wchar *str2)
{ {
wchar tempstr[264]; wchar tempstr[256];
if (!str1 || !str2) return; if (!str1 || !str2) return;
@ -432,7 +432,7 @@ CMessages::InsertPlayerControlKeysInString(wchar *str)
{ {
uint16 i; uint16 i;
wchar outstr[256]; wchar outstr[256];
wchar keybuf[264]; wchar keybuf[256];
if (!str) return; if (!str) return;
uint16 strSize = GetWideStringLength(str); uint16 strSize = GetWideStringLength(str);
@ -472,7 +472,7 @@ CMessages::InsertPlayerControlKeysInString(wchar *str)
void void
CMessages::AddMessageWithNumber(wchar *str, uint32 time, uint16 flag, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6) CMessages::AddMessageWithNumber(wchar *str, uint32 time, uint16 flag, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6)
{ {
wchar outstr[520]; // unused wchar outstr[512]; // unused
InsertNumberInString(str, n1, n2, n3, n4, n5, n6, outstr); InsertNumberInString(str, n1, n2, n3, n4, n5, n6, outstr);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
GetWideStringLength(outstr); GetWideStringLength(outstr);
@ -509,7 +509,7 @@ CMessages::AddMessageWithNumber(wchar *str, uint32 time, uint16 flag, int32 n1,
void void
CMessages::AddMessageJumpQWithNumber(wchar *str, uint32 time, uint16 flag, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6) CMessages::AddMessageJumpQWithNumber(wchar *str, uint32 time, uint16 flag, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6)
{ {
wchar outstr[520]; // unused wchar outstr[512]; // unused
InsertNumberInString(str, n1, n2, n3, n4, n5, n6, outstr); InsertNumberInString(str, n1, n2, n3, n4, n5, n6, outstr);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
GetWideStringLength(outstr); GetWideStringLength(outstr);
@ -531,7 +531,7 @@ CMessages::AddMessageJumpQWithNumber(wchar *str, uint32 time, uint16 flag, int32
void void
CMessages::AddMessageSoonWithNumber(wchar *str, uint32 time, uint16 flag, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6) CMessages::AddMessageSoonWithNumber(wchar *str, uint32 time, uint16 flag, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6)
{ {
wchar outstr[520]; // unused wchar outstr[512]; // unused
InsertNumberInString(str, n1, n2, n3, n4, n5, n6, outstr); InsertNumberInString(str, n1, n2, n3, n4, n5, n6, outstr);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
GetWideStringLength(outstr); GetWideStringLength(outstr);
@ -570,7 +570,7 @@ CMessages::AddMessageSoonWithNumber(wchar *str, uint32 time, uint16 flag, int32
void void
CMessages::AddBigMessageWithNumber(wchar *str, uint32 time, uint16 style, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6) CMessages::AddBigMessageWithNumber(wchar *str, uint32 time, uint16 style, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6)
{ {
wchar outstr[520]; // unused wchar outstr[512]; // unused
InsertNumberInString(str, n1, n2, n3, n4, n5, n6, outstr); InsertNumberInString(str, n1, n2, n3, n4, n5, n6, outstr);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
GetWideStringLength(outstr); GetWideStringLength(outstr);
@ -591,7 +591,7 @@ CMessages::AddBigMessageWithNumber(wchar *str, uint32 time, uint16 style, int32
void void
CMessages::AddBigMessageWithNumberQ(wchar *str, uint32 time, uint16 style, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6) CMessages::AddBigMessageWithNumberQ(wchar *str, uint32 time, uint16 style, int32 n1, int32 n2, int32 n3, int32 n4, int32 n5, int32 n6)
{ {
wchar outstr[520]; // unused wchar outstr[512]; // unused
InsertNumberInString(str, n1, n2, n3, n4, n5, n6, outstr); InsertNumberInString(str, n1, n2, n3, n4, n5, n6, outstr);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
GetWideStringLength(outstr); GetWideStringLength(outstr);
@ -619,7 +619,7 @@ CMessages::AddBigMessageWithNumberQ(wchar *str, uint32 time, uint16 style, int32
void void
CMessages::AddMessageWithString(wchar *text, uint32 time, uint16 flag, wchar *str) CMessages::AddMessageWithString(wchar *text, uint32 time, uint16 flag, wchar *str)
{ {
wchar outstr[516]; // unused wchar outstr[512]; // unused
WideStringCopy(outstr, text, 256); WideStringCopy(outstr, text, 256);
InsertStringInString(outstr, str); InsertStringInString(outstr, str);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);
@ -657,7 +657,7 @@ CMessages::AddMessageWithString(wchar *text, uint32 time, uint16 flag, wchar *st
void void
CMessages::AddMessageJumpQWithString(wchar *text, uint32 time, uint16 flag, wchar *str) CMessages::AddMessageJumpQWithString(wchar *text, uint32 time, uint16 flag, wchar *str)
{ {
wchar outstr[516]; // unused wchar outstr[512]; // unused
WideStringCopy(outstr, text, 256); WideStringCopy(outstr, text, 256);
InsertStringInString(outstr, str); InsertStringInString(outstr, str);
InsertPlayerControlKeysInString(outstr); InsertPlayerControlKeysInString(outstr);