Show correct max length in help text for MACRO_CONFIG_STR

This commit is contained in:
furo 2023-10-09 00:53:28 +02:00
parent d6aa18e5b4
commit f39792f330

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"