From: Tom Tromey Date: Mon, 24 Oct 2016 11:06:39 +0000 (+0100) Subject: PR gdb/20653 - small cleanup in string_to_explicit_location X-Git-Tag: users/ARM/embedded-gdb-7.12-branch-2016q4~46 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=909de2c5cc91b815d671f7018da2a925fbd19aaf;p=thirdparty%2Fbinutils-gdb.git 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 PR breakpoints/20653: * location.c (string_to_explicit_location): Use NULL, not '\0'. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5c53747d4a7..66bb531bd90 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2016-10-24 Tom Tromey + + PR breakpoints/20653: + * location.c (string_to_explicit_location): Use NULL, not '\0'. + 2016-10-14 Eli Zaretskii * common/common-defs.h [HAVE_STRINGS_H]: Include strings.h if diff --git a/gdb/location.c b/gdb/location.c index 65116c732f7..8dce21ada12 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'))