From: Stefan Reinauer Date: Wed, 17 Jun 2026 14:30:16 +0000 (-0700) Subject: cfgfile: handle missing command line option values X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=7763cc77a7fe11dd71983e072b295cad69884e0e;p=francis%2Fwinuae.git cfgfile: handle missing command line option values parse_cmdline_option() keeps unknown command line options in the all_lines list. A trailing option such as -G reaches this path without a value, which passed NULL to my_strdup() and crashed before the GUI could start. Store an empty string when no value is present so argument-less options can still be represented in the saved option list. --- diff --git a/cfgfile.cpp b/cfgfile.cpp index d676dc65..3a6f72c9 100644 --- a/cfgfile.cpp +++ b/cfgfile.cpp @@ -7754,7 +7754,7 @@ int parse_cmdline_option (struct uae_prefs *p, TCHAR c, const TCHAR *arg) u->option = xmalloc (TCHAR, 2); u->option[0] = c; u->option[1] = 0; - u->value = my_strdup (arg); + u->value = my_strdup (arg ? arg : _T("")); u->next = p->all_lines; p->all_lines = u;