diff options
author | Gilles Chehade <gilles@poolp.org> | 2019-09-19 01:43:45 +0200 |
---|---|---|
committer | Gilles Chehade <gilles@poolp.org> | 2019-09-19 01:43:45 +0200 |
commit | 7b8160f899b9256825e200a6b15a5502f2397afa (patch) | |
tree | 781110e32f01a62e47eb41cb14c6c829b2d3b10a | |
parent | EAUTH doesnt exist everywhere (diff) | |
download | OpenSMTPD-7b8160f899b9256825e200a6b15a5502f2397afa.tar.xz OpenSMTPD-7b8160f899b9256825e200a6b15a5502f2397afa.zip |
fix build
-rw-r--r-- | smtpd/smtpc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/smtpd/smtpc.c b/smtpd/smtpc.c index 4f0e5261..4c8c0476 100644 --- a/smtpd/smtpc.c +++ b/smtpd/smtpc.c @@ -155,13 +155,17 @@ main(int argc, char **argv) if (!noaction) parse_message(stdin); +#if HAVE_PLEDGE if (pledge("stdio inet dns", NULL) == -1) fatal("pledge"); +#endif parse_server(server); +#if HAVE_PLEDGE if (pledge("stdio inet", NULL) == -1) fatal("pledge"); +#endif resume(); @@ -294,7 +298,7 @@ parse_message(FILE *ifp) if (len >= 2 && line[len - 2] == '\r' && line[len - 1] == '\n') line[--len - 1] = '\n'; - if (fwrite(line, 1, len, mail.fp) != len) + if (fwrite(line, 1, len, mail.fp) != (size_t)len) fatal("fwrite"); if (line[len - 1] != '\n' && fputc('\n', mail.fp) == EOF) @@ -320,7 +324,7 @@ resume(void) if (ai == NULL) fatalx("no more host"); - getnameinfo(ai->ai_addr, ai->ai_addr->sa_len, + getnameinfo(ai->ai_addr, SA_LEN(ai->ai_addr), host, sizeof(host), serv, sizeof(serv), NI_NUMERICHOST | NI_NUMERICSERV); log_debug("trying host %s port %s...", host, serv); |