This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v2 02/31] cli/cli-script.c: Remove some dead NULL checks


On 2016-10-18 21:11, Pedro Alves wrote:
@@ -853,8 +845,6 @@ insert_args (char *line)

   /* Allocate space for the new line and fill it in.  */
   new_line = (char *) xmalloc (len + 1);
-  if (new_line == NULL)
-    return NULL;

   /* Restore pointer to beginning of old line.  */
   line = save_line;

A few lines higher in insert_args, there is:

    error (_("Missing argument %d in user function."), i);
    return NULL;

That return NULL is also dead code and could be confusing, leading someone to think insert_args can return NULL. I think you could remove it at the same time.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]