PR gdb/20653 - small cleanup in string_to_explicit_location
authorTom Tromey <tom@tromey.com>
Fri, 30 Sep 2016 21:43:40 +0000 (15:43 -0600)
committerTom Tromey <tom@tromey.com>
Wed, 5 Oct 2016 16:31:34 +0000 (10:31 -0600)
This bug points out that string_to_explicit_location compares a char*
against '\0'; whereas comparing against NULL is more normal.

2016-10-05  Tom Tromey  <tom@tromey.com>

PR breakpoints/20653:
* location.c (string_to_explicit_location): Use NULL, not '\0'.

gdb/ChangeLog
gdb/location.c

index 1fc318e..225bf75 100644 (file)
@@ -1,5 +1,10 @@
 2016-10-05  Tom Tromey  <tom@tromey.com>
 
+       PR breakpoints/20653:
+       * location.c (string_to_explicit_location): Use NULL, not '\0'.
+
+2016-10-05  Tom Tromey  <tom@tromey.com>
+
        PR symtab/20652:
        * psymtab.c (psymbol_compare): Correctly compare "ginfo.value"
        fields.
index 65116c7..8dce21a 100644 (file)
@@ -524,7 +524,7 @@ string_to_explicit_location (const char **argp,
      character is an explicit location.  "-p" is reserved, though,
      for probe locations.  */
   if (argp == NULL
-      || *argp == '\0'
+      || *argp == NULL
       || *argp[0] != '-'
       || !isalpha ((*argp)[1])
       || ((*argp)[0] == '-' && (*argp)[1] == 'p'))