aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2016-10-24 12:06:39 +0100
committerYao Qi <yao.qi@linaro.org>2016-10-24 12:06:39 +0100
commit909de2c5cc91b815d671f7018da2a925fbd19aaf (patch)
tree09eeea91976d17dca8dba2a1747dafe6ed2b422b /gdb
parenta945860b6cb4f8a26343ac5dcb0b42fe5fb2f68a (diff)
downloadgdb-909de2c5cc91b815d671f7018da2a925fbd19aaf.zip
gdb-909de2c5cc91b815d671f7018da2a925fbd19aaf.tar.gz
gdb-909de2c5cc91b815d671f7018da2a925fbd19aaf.tar.bz2
PR gdb/20653 - small cleanup in string_to_explicit_location
This bug points out that string_to_explicit_location compares a char* against '\0'; whereas comparing against NULL is more normal. 2016-10-24 Tom Tromey <tom@tromey.com> PR breakpoints/20653: * location.c (string_to_explicit_location): Use NULL, not '\0'.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/location.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 5c53747..66bb531 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2016-10-24 Tom Tromey <tom@tromey.com>
+
+ PR breakpoints/20653:
+ * location.c (string_to_explicit_location): Use NULL, not '\0'.
+
2016-10-14 Eli Zaretskii <eliz@gnu.org>
* common/common-defs.h [HAVE_STRINGS_H]: Include strings.h if
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'))