Skip to content
This repository was archived by the owner on Mar 31, 2024. It is now read-only.

Commit 56dc8b7

Browse files
committed
修改输入代码长度上限,将run指令输出长度上限单独脱离出来不再使用MAX_TEXT
1 parent 0b3ae63 commit 56dc8b7

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

BOIT Server/Command_run.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ typedef struct __tagInputSession
6767
}INPUT_SESSION, * pINPUT_SESSION;
6868

6969

70+
71+
72+
//run指令最长输出
73+
#define BOIT_RUN_MAX_OUTPUT 2048
74+
75+
76+
7077
pBOIT_COMMAND pRunCmd;// 存下来给savecode什么的用
7178

7279
BOOL FindCompileConfig(pBOIT_COMMAND pCmd, WCHAR* LanguageName, int LanguageLen, WCHAR* ConfigSuffix, pCOMPILE_CFG CompileCfg);
@@ -625,9 +632,9 @@ int RunSandboxCallback(pSANDBOX Sandbox, PBYTE pData, UINT Event, PBYTE StdOutDa
625632
if (wcStdout)
626633
{
627634
//实行截断
628-
if (cchStdout > BOIT_MAX_TEXTLEN)
635+
if (cchStdout > BOIT_RUN_MAX_OUTPUT)
629636
{
630-
wcStdout[BOIT_MAX_TEXTLEN] = 0;
637+
wcStdout[BOIT_RUN_MAX_OUTPUT] = 0;
631638
}
632639
SendTextWithBOITCode(Session->boitSession, wcStdout);
633640
free(wcStdout);

BOIT Shared/BOITInfoMaxDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#include<Windows.h>
33

44
//各种类型信息最大长度定义
5-
#define BOIT_MAX_TEXTLEN 2048 //超出长度的一律截断
5+
#define BOIT_MAX_TEXTLEN 3072 //超出长度的一律截断
66
#define BOIT_MAX_NICKLEN 64
77
#define BOIT_MAX_LOCATION 64 //地名最长
88
#define BOIT_MAX_LEVELNAME 32 //群等级名称最长

0 commit comments

Comments
 (0)