diff options
author | Ron Unrau <runrau@cygnus> | 1998-03-01 14:49:50 +0000 |
---|---|---|
committer | Ron Unrau <runrau@cygnus> | 1998-03-01 14:49:50 +0000 |
commit | aac9328044befd167030b1ec2974e1f99d665581 (patch) | |
tree | 160df284ac0eb2453ee1c960ae2fc437d17ceed4 | |
parent | aaab4e578d6b6ebdfdf63ec25e012ffde264d800 (diff) | |
download | binutils-aac9328044befd167030b1ec2974e1f99d665581.zip binutils-aac9328044befd167030b1ec2974e1f99d665581.tar.gz binutils-aac9328044befd167030b1ec2974e1f99d665581.tar.bz2 |
(find_match): recheck argv[argi] in multi-word match. Fixes crash when
subset words are alone on the command line.
-rw-r--r-- | sim/common/sim-options.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sim/common/sim-options.c b/sim/common/sim-options.c index e94f9aa..01d1a7e 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] == '-') |