On Tue, Oct 15, 2024 at 09:34:09PM +0100, Gavin Smith wrote:
> I used xasprintf (wrapper around libc function asprintf) here instead
> as it is shorter and more robust.
>
> Patrice already replied about the initialiser of 'description'. However,
> as the code currently stands, there is code that will never run:
>
> char *description;
> NODE *node;
>
> if (!strcmp (label, "Up"))
> description = window->node->up;
> else if (!strcmp (label, "Next"))
> description = window->node->next;
> else if (!strcmp (label, "Prev"))
> description = window->node->prev;
> else /* Should not happen */
> abort ();
>
> if (!description)
> {
> info_error (msg_no_pointer, label);
> return 0;
> }
>
> The final call to info_error will never run. I am going to remove it.
Sorry, I am completely wrong here - it will run if window->node->up etc.
is null.