From: Tom de Vries Date: Mon, 31 Mar 2025 14:12:22 +0000 (+0200) Subject: [gdb] Check strpbrk against nullptr X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=80a7eb6ac7d6661b06e014329cac101e83d2003c;p=thirdparty%2Fbinutils-gdb.git [gdb] Check strpbrk against nullptr In noticed two occurrences of "if (strpbrk (...))". Fix this style issue by checking against nullptr. --- diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index 84533669b53..7852f5653f9 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -697,7 +697,7 @@ go32_nat_target::create_inferior (const char *exec_file, "not enough memory.\n")); /* Parse the command line and create redirections. */ - if (strpbrk (args, "<>")) + if (strpbrk (args, "<>") != nullptr) { if (redir_cmdline_parse (args, &child_cmd) == 0) args = child_cmd.command; diff --git a/gdbsupport/common-inferior.cc b/gdbsupport/common-inferior.cc index e544780bd4b..d2fd348fe07 100644 --- a/gdbsupport/common-inferior.cc +++ b/gdbsupport/common-inferior.cc @@ -59,7 +59,7 @@ escape_characters (const char *arg, const char *special) #ifdef __MINGW32__ bool quoted = false; - if (strpbrk (arg, special)) + if (strpbrk (arg, special) != nullptr) { quoted = true; result += quote;