From 94e4274dc0e36cc3c3927e09f7e8ca41b39a8dd7 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Thu, 9 Jun 2011 14:21:43 +0000 Subject: [PATCH] sim/ppc: Fix check for --sysroot= option Fixes an error reported by Tristan and which can be evidenced by doing: % powerpc-elf-gdb (gdb) target sim --sysroot=var Invalid option: --sysroot=/var [...] sim/ppc/ChangeLog: * psim.c (psim_options): Fix length of comparison when checking for --sysroot= option. --- sim/ppc/ChangeLog | 5 +++++ sim/ppc/psim.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/sim/ppc/ChangeLog b/sim/ppc/ChangeLog index 5e6fff6fbb..455585adc3 100644 --- a/sim/ppc/ChangeLog +++ b/sim/ppc/ChangeLog @@ -1,3 +1,8 @@ +2011-06-09 Joel Brobecker + + * psim.c (psim_options): Fix length of comparison when checking + for --sysroot= option. + 2011-06-08 Joel Brobecker * psim.c (psim_options): Add option that cause the error diff --git a/sim/ppc/psim.c b/sim/ppc/psim.c index d814486be3..3e7638690a 100644 --- a/sim/ppc/psim.c +++ b/sim/ppc/psim.c @@ -359,7 +359,7 @@ psim_options(device *root, else if (strcmp (argv[argp], "--help") == 0) psim_usage (0, 1); else if (strncmp (argv[argp], "--sysroot=", - sizeof ("--sysroot=")) == 0) + sizeof ("--sysroot=") - 1) == 0) /* Ignore this option. */ p = argv[argp] + strlen(argv[argp]) - 1; else if (strcmp (argv[argp], "--version") == 0) -- 2.34.1