mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 17:06:29 +00:00
Handle NULL strings when parsing boolean arguments
This commit is contained in:
@@ -1531,6 +1531,9 @@ parse_bool(const char *s, const char *config_item, ItemList *error_list)
|
|||||||
{
|
{
|
||||||
PQExpBufferData errors;
|
PQExpBufferData errors;
|
||||||
|
|
||||||
|
if (s == NULL)
|
||||||
|
return true;
|
||||||
|
|
||||||
if (strcasecmp(s, "0") == 0)
|
if (strcasecmp(s, "0") == 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -175,7 +175,6 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
/* daemon options */
|
/* daemon options */
|
||||||
|
|
||||||
|
|
||||||
case 'd':
|
case 'd':
|
||||||
daemonize = true;
|
daemonize = true;
|
||||||
break;
|
break;
|
||||||
@@ -184,7 +183,6 @@ main(int argc, char **argv)
|
|||||||
daemonize = parse_bool(optarg, "-d/--daemonize", &cli_errors);
|
daemonize = parse_bool(optarg, "-d/--daemonize", &cli_errors);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
case 'p':
|
case 'p':
|
||||||
strncpy(pid_file, optarg, MAXPGPATH);
|
strncpy(pid_file, optarg, MAXPGPATH);
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user