This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 2/3] PR gdb/20653 - small cleanup in string_to_explicit_location
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Mon, 3 Oct 2016 15:54:05 -0600
- Subject: [RFA 2/3] PR gdb/20653 - small cleanup in string_to_explicit_location
- Authentication-results: sourceware.org; auth=none
- References: <1475531646-18049-1-git-send-email-tom@tromey.com>
This bug points out that string_to_explicit_location compares a char*
against '\0'; whereas comparing against NULL is more normal.
2016-10-03 Tom Tromey <tom@tromey.com>
PR breakpoints/20653:
* location.c (string_to_explicit_location): Use NULL, not '\0'.
---
gdb/ChangeLog | 5 +++++
gdb/location.c | 2 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 434f750..7a7ba1c 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
2016-10-03 Tom Tromey <tom@tromey.com>
+ PR breakpoints/20653:
+ * location.c (string_to_explicit_location): Use NULL, not '\0'.
+
+2016-10-03 Tom Tromey <tom@tromey.com>
+
PR symtab/20652:
* psymtab.c (psymbol_compare): Correctly compare "ginfo.value"
fields.
diff --git a/gdb/location.c b/gdb/location.c
index 65116c7..8dce21a 100644
--- a/gdb/location.c
+++ b/gdb/location.c
@@ -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'))
--
2.7.4