Merge pull request #7327 from furo321/correct-max-length

Show correct max length in help text for `MACRO_CONFIG_STR`
This commit is contained in:
Dennis Felsing 2023-10-09 06:52:43 +00:00 committed by GitHub
commit 1fb0235f4b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1041,7 +1041,9 @@ void CConsole::Init()
{ \ { \
static char s_aOldValue[Len] = Def; \ static char s_aOldValue[Len] = Def; \
static CStrVariableData Data = {this, g_Config.m_##Name, Len, s_aOldValue}; \ static CStrVariableData Data = {this, g_Config.m_##Name, Len, s_aOldValue}; \
Register(#ScriptName, "?r", Flags, StrVariableCommand, &Data, Desc " (default: " #Def ", max length: " #Len ")"); \ static char s_aHelp[256]; \
str_format(s_aHelp, sizeof(s_aHelp), "%s (default: \"%s\", max length: %d)", Desc, Def, Len - 1); \
Register(#ScriptName, "?r", Flags, StrVariableCommand, &Data, s_aHelp); \
} }
#include "config_variables.h" #include "config_variables.h"