config fixes (#854)

* fix wrong limit for `midi_player` config variable

* increase `MAX_MIDI_PLAYER_MENU_ITEMS` to 128

* increase maximum config parameter length to 256 (MAX_PATH on Windows)

* increase the buffer to 1024, because why not
This commit is contained in:
Roman Fomin 2022-12-26 18:16:10 +07:00 committed by GitHub
parent 83878a8cd0
commit 6a38d3832c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -198,7 +198,7 @@ typedef enum
extern background_t menu_background; extern background_t menu_background;
extern boolean M_MenuIsShaded(void); extern boolean M_MenuIsShaded(void);
#define MAX_MIDI_PLAYER_MENU_ITEMS 16 #define MAX_MIDI_PLAYER_MENU_ITEMS 128
extern void M_GetMidiDevices(void); extern void M_GetMidiDevices(void);
#endif #endif

View File

@ -2310,7 +2310,7 @@ default_t defaults[] = {
{ {
"midi_player_menu", "midi_player_menu",
(config_t *) &midi_player_menu, NULL, (config_t *) &midi_player_menu, NULL,
{0}, {0, MAX_MIDI_PLAYER_MENU_ITEMS - 1}, number, ss_gen, wad_no, {0}, {0, MAX_MIDI_PLAYER_MENU_ITEMS}, number, ss_gen, wad_no,
"MIDI Player menu index" "MIDI Player menu index"
}, },
@ -2739,7 +2739,7 @@ void M_SaveDefaults (void)
boolean M_ParseOption(const char *p, boolean wad) boolean M_ParseOption(const char *p, boolean wad)
{ {
char name[80], strparm[100]; char name[80], strparm[1024];
default_t *dp; default_t *dp;
int parm; int parm;
@ -2749,7 +2749,7 @@ boolean M_ParseOption(const char *p, boolean wad)
//jff 3/3/98 skip lines not starting with an alphanum //jff 3/3/98 skip lines not starting with an alphanum
// killough 10/98: move to be made part of main test, add comment-handling // killough 10/98: move to be made part of main test, add comment-handling
if (sscanf(p, "%79s %99[^\n]", name, strparm) != 2 || !isalnum(*name) || if (sscanf(p, "%79s %1023[^\n]", name, strparm) != 2 || !isalnum(*name) ||
!(dp = M_LookupDefault(name)) || !(dp = M_LookupDefault(name)) ||
(*strparm == '"') == (dp->type != string) || (*strparm == '"') == (dp->type != string) ||
(wad && !dp->wad_allowed)) (wad && !dp->wad_allowed))