summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/ssl.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2008-12-11 23:01:17 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2008-12-11 23:01:17 +0000
commit91afdfb6c0efb316110bb2e2223c8af413e26f73 (patch)
treeae97adedaf4d7ffe740b44068bdd9b3b9859b326 /usr.sbin/smtpd/ssl.c
parente7a71a195980b8b0914a4ea59a059a13f56ef610 (diff)
- snprintf -> bsnprintf
Diffstat (limited to 'usr.sbin/smtpd/ssl.c')
-rw-r--r--usr.sbin/smtpd/ssl.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/usr.sbin/smtpd/ssl.c b/usr.sbin/smtpd/ssl.c
index b70bab95713..3c2cefedbb7 100644
--- a/usr.sbin/smtpd/ssl.c
+++ b/usr.sbin/smtpd/ssl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssl.c,v 1.3 2008/11/10 00:57:35 gilles Exp $ */
+/* $OpenBSD: ssl.c,v 1.4 2008/12/11 23:01:16 gilles Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -285,7 +285,6 @@ ssl_load_certfile(struct smtpd *env, const char *name)
struct ssl *s;
struct ssl key;
char certfile[PATH_MAX];
- int spret;
if (strlcpy(key.ssl_name, name, sizeof(key.ssl_name))
>= sizeof(key.ssl_name)) {
@@ -302,9 +301,8 @@ ssl_load_certfile(struct smtpd *env, const char *name)
(void)strlcpy(s->ssl_name, key.ssl_name, sizeof(s->ssl_name));
- spret = snprintf(certfile, sizeof(certfile),
- "/etc/mail/certs/%s.crt", name);
- if (spret == -1 || spret >= (int)sizeof(certfile)) {
+ if (! bsnprintf(certfile, sizeof(certfile),
+ "/etc/mail/certs/%s.crt", name)) {
free(s);
return (-1);
}
@@ -314,9 +312,8 @@ ssl_load_certfile(struct smtpd *env, const char *name)
return (-1);
}
- spret = snprintf(certfile, sizeof(certfile),
- "/etc/mail/certs/%s.key", name);
- if (spret == -1 || spret >= (int)sizeof(certfile)) {
+ if (! bsnprintf(certfile, sizeof(certfile),
+ "/etc/mail/certs/%s.key", name)) {
free(s->ssl_cert);
free(s);
return -1;