mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-04-19 13:12:53 +00:00
largest gsc string is 65535, but u cant concat gsc strings > 8191 chars, ull get an error
This commit is contained in:
parent
56e8c485af
commit
4963a9180a
@ -10,6 +10,7 @@ namespace fileio
|
||||
namespace
|
||||
{
|
||||
static constexpr size_t max_fhs = 10;
|
||||
static constexpr size_t max_gsc_string = 0x10000 - 1;
|
||||
|
||||
enum class scr_fh_type_e
|
||||
{
|
||||
@ -293,10 +294,10 @@ namespace fileio
|
||||
}
|
||||
}
|
||||
|
||||
if (bytes_to_read > 8191)
|
||||
if (bytes_to_read > max_gsc_string)
|
||||
{
|
||||
found_nl = false;
|
||||
bytes_to_read = 8191;
|
||||
bytes_to_read = max_gsc_string;
|
||||
|
||||
game::Com_PrintWarning(game::CON_CHANNEL_SCRIPT, "Line was too long in file %s, truncating\n", scr_fhs[fh].base_path.c_str());
|
||||
}
|
||||
@ -348,9 +349,9 @@ namespace fileio
|
||||
}
|
||||
}
|
||||
|
||||
if (bytes_to_read > 8191)
|
||||
if (bytes_to_read > max_gsc_string)
|
||||
{
|
||||
bytes_to_read = 8191;
|
||||
bytes_to_read = max_gsc_string;
|
||||
|
||||
game::Com_PrintWarning(game::CON_CHANNEL_SCRIPT, "Line was too long in file %s, truncating\n", scr_fhs[fh].base_path.c_str());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user