[gdb] Check strpbrk against nullptr

In noticed two occurrences of "if (strpbrk (...))".

Fix this style issue by checking against nullptr.
This commit is contained in:
Tom de Vries
2025-03-31 16:12:22 +02:00
parent 7b34a95034
commit 80a7eb6ac7
2 changed files with 2 additions and 2 deletions

View File

@@ -697,7 +697,7 @@ go32_nat_target::create_inferior (const char *exec_file,
"not enough memory.\n")); "not enough memory.\n"));
/* Parse the command line and create redirections. */ /* Parse the command line and create redirections. */
if (strpbrk (args, "<>")) if (strpbrk (args, "<>") != nullptr)
{ {
if (redir_cmdline_parse (args, &child_cmd) == 0) if (redir_cmdline_parse (args, &child_cmd) == 0)
args = child_cmd.command; args = child_cmd.command;

View File

@@ -59,7 +59,7 @@ escape_characters (const char *arg, const char *special)
#ifdef __MINGW32__ #ifdef __MINGW32__
bool quoted = false; bool quoted = false;
if (strpbrk (arg, special)) if (strpbrk (arg, special) != nullptr)
{ {
quoted = true; quoted = true;
result += quote; result += quote;