mirror of
git://git.code.sf.net/p/dhcpd-pools/code
synced 2025-12-16 15:57:00 +00:00
output: improve mustach template parsing error
Following error did not inform clearly what is wrong. $ ./dhcpd-pools -l samples/dhcpd.leases -c samples/dhcpd.conf -fm ./dhcpd-pools: must_read_template: open: (null): Bad address Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
5a8c178924
commit
a237c11d5a
1 changed files with 2 additions and 0 deletions
|
|
@ -276,6 +276,8 @@ static char *must_read_template(const char *filename)
|
|||
struct stat s;
|
||||
char *result;
|
||||
|
||||
if (filename == NULL)
|
||||
error(EXIT_FAILURE, 0, "must_read_template: --mustach argument missing");
|
||||
if ((f = open(filename, O_RDONLY)) < 0) {
|
||||
error(EXIT_FAILURE, errno, "must_read_template: open: %s", filename);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue