sim/ppc: Fix check for --sysroot= option
authorJoel Brobecker <brobecker@gnat.com>
Thu, 9 Jun 2011 14:21:43 +0000 (14:21 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 9 Jun 2011 14:21:43 +0000 (14:21 +0000)
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
sim/ppc/psim.c

index 5e6fff6fbb0daefd191f8305fcabac4a9bf8e918..455585adc3cd202d2d5be1c58fd35a0565fa2e8f 100644 (file)
@@ -1,3 +1,8 @@
+2011-06-09  Joel Brobecker  <brobecker@adacore.com>
+
+       * psim.c (psim_options): Fix length of comparison when checking
+       for --sysroot= option.
+
 2011-06-08  Joel Brobecker  <brobecker@adacore.com>
 
        * psim.c (psim_options): Add option that cause the error
index d814486be330206de34f0afc1966f731a859fa60..3e7638690a1c83e2f9cbeb68d0c31c4289dd0833 100644 (file)
@@ -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)
This page took 0.032633 seconds and 4 git commands to generate.