Re: [PATCH] Fix missing argument handling in psql getopt

Quentin Rameau <quinq@fifth.space>

From: Quentin Rameau <quinq@fifth.space>
To: pgsql-hackers@lists.postgresql.org
Date: 2019-08-25T16:01:25Z
Lists: pgsql-hackers
> > Um ... so how would control get there with optind too large?

Sorry, I missed the simple explanation for that:

As option 'h' is missing an argument, getopt(_long) returns the
character '?' which is switched on through variable c, and the program
jumps to the '?' case handling.



Commits

  1. Avoid platform-specific null pointer dereference in psql.