Attempt to mitigate segmentation faults on help printout by reducing the size of the help string.

This commit is contained in:
OBattler
2025-08-09 14:38:53 +02:00
parent a1b0d535e1
commit f9865b159a

View File

@@ -601,7 +601,9 @@ pc_show_usage(char *s)
"\n%sUsage: 86box [options] [cfg-file]\n\n" "\n%sUsage: 86box [options] [cfg-file]\n\n"
"Valid options are:\n\n" "Valid options are:\n\n"
"-? or --help\t\t\t- show this information\n" "-? or --help\t\t\t- show this information\n"
#ifdef SHOW_EXTRA_PARAMS
"-C or --config path\t\t- set 'path' to be config file\n" "-C or --config path\t\t- set 'path' to be config file\n"
#endif
#ifdef _WIN32 #ifdef _WIN32
"-D or --debug\t\t\t- force debug output logging\n" "-D or --debug\t\t\t- force debug output logging\n"
#endif #endif
@@ -627,17 +629,23 @@ pc_show_usage(char *s)
#ifndef USE_SDL_UI #ifndef USE_SDL_UI
"-S or --settings\t\t\t- show only the settings dialog\n" "-S or --settings\t\t\t- show only the settings dialog\n"
#endif #endif
#ifdef SHOW_EXTRA_PARAMS
"-T or --testmode\t\t- test mode: execute the test mode entry\n" "-T or --testmode\t\t- test mode: execute the test mode entry\n"
"\t\t\t\t point on init/hard reset\n" "\t\t\t\t point on init/hard reset\n"
#endif
"-V or --vmname name\t\t- overrides the name of the running VM\n" "-V or --vmname name\t\t- overrides the name of the running VM\n"
#ifdef _WIN32
"-W or --nohook\t\t- disables keyboard hook\n" "-W or --nohook\t\t- disables keyboard hook\n"
"\t\t\t\t (compatibility-only outside Windows)\n" #else
"-W or --nohook\t\t- alters keyboard behavior\n"
#endif
"-X or --clear what\t\t- clears the 'what' (cmos/flash/both)\n" "-X or --clear what\t\t- clears the 'what' (cmos/flash/both)\n"
#ifdef SHOW_EXTRA_PARAMS
"-Y or --donothing\t\t- do not show any UI or run the emulation\n" "-Y or --donothing\t\t- do not show any UI or run the emulation\n"
"-Z or --lastvmpath\t\t- the last parameter is VM path rather\n" #endif
"\t\t\t\t than config\n" "-Z or --lastvmpath\t\t- the last parameter is VM path rather than config\n"
"\nA config file can be specified. If none is, the default file will be used.\n", "\nA config file can be specified. If none is, the default file will be used.\n",
(s == NULL) ? "" : s); s);
#ifdef _WIN32 #ifdef _WIN32
ui_msgbox(MBX_ANSI | ((s == NULL) ? MBX_INFO : MBX_WARNING), p); ui_msgbox(MBX_ANSI | ((s == NULL) ? MBX_INFO : MBX_WARNING), p);
@@ -733,7 +741,7 @@ usage:
} }
} }
pc_show_usage(NULL); pc_show_usage("");
return 0; return 0;
} else if (!strcasecmp(argv[c], "--lastvmpath") || !strcasecmp(argv[c], "-Z")) { } else if (!strcasecmp(argv[c], "--lastvmpath") || !strcasecmp(argv[c], "-Z")) {
lvmp = 1; lvmp = 1;