1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-03-03 15:42:18 +02:00

Fix printing NULL values

This commit is contained in:
Konstantin Knizhnik 2019-03-01 11:18:00 +03:00
parent 6e9a5793ef
commit 4097e10754

View File

@ -267,12 +267,24 @@ assign_option(ConfigOption *opt, const char *optarg, OptionSource src)
}
}
if (isprint(opt->sname))
elog(ERROR, "Option -%c, --%s should be %s: '%s'",
opt->sname, opt->lname, message, optarg);
if (optarg)
{
if (isprint(opt->sname))
elog(ERROR, "Option -%c, --%s should be %s: '%s'",
opt->sname, opt->lname, message, optarg);
else
elog(ERROR, "Option --%s should be %s: '%s'",
opt->lname, message, optarg);
}
else
elog(ERROR, "Option --%s should be %s: '%s'",
opt->lname, message, optarg);
{
if (isprint(opt->sname))
elog(ERROR, "Option -%c, --%s should be %s",
opt->sname, opt->lname, message);
else
elog(ERROR, "Option --%s should be %s",
opt->lname, message);
}
}
static const char *