From: Ron Unrau Date: Sun, 1 Mar 1998 14:49:50 +0000 (+0000) Subject: (find_match): recheck argv[argi] in multi-word match. Fixes crash when X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=aac9328044befd167030b1ec2974e1f99d665581;p=binutils-gdb.git (find_match): recheck argv[argi] in multi-word match. Fixes crash when subset words are alone on the command line. --- diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index e94f9aad43d..01d1a7e5b90 100644 --- a/sim/common/sim-options.c +++ b/sim/common/sim-options.c @@ -803,7 +803,8 @@ find_match (SIM_DESC sd, sim_cpu *cpu, char *argv[], int *pargi) const char *name = opt->opt.name; if (name == NULL) continue; - while (strncmp (name, argv [argi], strlen (argv [argi])) == 0) + while (argv [argi] != NULL + && strncmp (name, argv [argi], strlen (argv [argi])) == 0) { name = &name [strlen (argv[argi])]; if (name [0] == '-')