summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgilles <gilles@openbsd.org>2008-12-11 23:04:45 +0000
committergilles <gilles@openbsd.org>2008-12-11 23:04:45 +0000
commite57f352e6ebae2d7d950a4c18ca081e0f155d7d5 (patch)
tree251b27ff96eb117827a8804d4babf9f7061ed8c1
parent- snprintf -> bsnprintf (diff)
downloadwireguard-openbsd-e57f352e6ebae2d7d950a4c18ca081e0f155d7d5.tar.xz
wireguard-openbsd-e57f352e6ebae2d7d950a4c18ca081e0f155d7d5.zip
- snprintf -> bsnprintf
- makemap and newaliases need util.c now
-rw-r--r--usr.sbin/smtpd/aliases.c18
-rw-r--r--usr.sbin/smtpd/makemap/Makefile4
-rw-r--r--usr.sbin/smtpd/newaliases/Makefile4
3 files changed, 11 insertions, 15 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c
index 60bf90e2917..800dad308bd 100644
--- a/usr.sbin/smtpd/aliases.c
+++ b/usr.sbin/smtpd/aliases.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aliases.c,v 1.10 2008/12/10 23:04:24 jacekm Exp $ */
+/* $OpenBSD: aliases.c,v 1.11 2008/12/11 23:04:45 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -139,7 +139,6 @@ aliases_virtual_exist(struct smtpd *env, struct path *path)
DB *aliasesdb;
struct map *map;
char strkey[MAX_LINE_SIZE];
- int spret;
map = map_findbyname(env, "virtual");
if (map == NULL)
@@ -149,8 +148,8 @@ aliases_virtual_exist(struct smtpd *env, struct path *path)
if (aliasesdb == NULL)
return 0;
- spret = snprintf(strkey, MAX_LINE_SIZE, "%s@%s", path->user, path->domain);
- if (spret == -1 || spret >= MAX_LINE_SIZE) {
+ if (! bsnprintf(strkey, MAX_LINE_SIZE, "%s@%s", path->user,
+ path->domain)) {
aliasesdb->close(aliasesdb);
return 0;
}
@@ -160,8 +159,7 @@ aliases_virtual_exist(struct smtpd *env, struct path *path)
if ((ret = aliasesdb->get(aliasesdb, &key, &val, 0)) != 0) {
- spret = snprintf(strkey, MAX_LINE_SIZE, "@%s", path->domain);
- if (spret == -1 || spret >= MAX_LINE_SIZE) {
+ if (! bsnprintf(strkey, MAX_LINE_SIZE, "@%s", path->domain)) {
aliasesdb->close(aliasesdb);
return 0;
}
@@ -193,7 +191,6 @@ aliases_virtual_get(struct smtpd *env, struct aliaseslist *aliases,
struct alias *nextalias;
struct map *map;
char strkey[MAX_LINE_SIZE];
- int spret;
map = map_findbyname(env, "virtual");
if (map == NULL)
@@ -203,8 +200,8 @@ aliases_virtual_get(struct smtpd *env, struct aliaseslist *aliases,
if (aliasesdb == NULL)
return 0;
- spret = snprintf(strkey, MAX_LINE_SIZE, "%s@%s", path->user, path->domain);
- if (spret == -1 || spret >= MAX_LINE_SIZE) {
+ if (! bsnprintf(strkey, MAX_LINE_SIZE, "%s@%s", path->user,
+ path->domain)) {
aliasesdb->close(aliasesdb);
return 0;
}
@@ -214,8 +211,7 @@ aliases_virtual_get(struct smtpd *env, struct aliaseslist *aliases,
if ((ret = aliasesdb->get(aliasesdb, &key, &val, 0)) != 0) {
- spret = snprintf(strkey, MAX_LINE_SIZE, "@%s", path->domain);
- if (spret == -1 || spret >= MAX_LINE_SIZE) {
+ if (! bsnprintf(strkey, MAX_LINE_SIZE, "@%s", path->domain)) {
aliasesdb->close(aliasesdb);
return 0;
}
diff --git a/usr.sbin/smtpd/makemap/Makefile b/usr.sbin/smtpd/makemap/Makefile
index 56c1a8654d8..00bb6db2290 100644
--- a/usr.sbin/smtpd/makemap/Makefile
+++ b/usr.sbin/smtpd/makemap/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2008/12/03 21:20:20 gilles Exp $
+# $OpenBSD: Makefile,v 1.2 2008/12/11 23:04:45 gilles Exp $
.PATH: ${.CURDIR}/..
@@ -10,6 +10,6 @@ BINMODE?=555
BINDIR= /usr/bin
MAN= makemap.8
-SRCS= makemap.c aliases.c map.c log.c
+SRCS= makemap.c aliases.c map.c log.c util.c
LDFLAGS= -lutil
.include <bsd.prog.mk>
diff --git a/usr.sbin/smtpd/newaliases/Makefile b/usr.sbin/smtpd/newaliases/Makefile
index 467cff799fe..9322dc11cda 100644
--- a/usr.sbin/smtpd/newaliases/Makefile
+++ b/usr.sbin/smtpd/newaliases/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.1 2008/12/03 21:13:18 gilles Exp $
+# $OpenBSD: Makefile,v 1.2 2008/12/11 23:04:45 gilles Exp $
.PATH: ${.CURDIR}/..
@@ -10,6 +10,6 @@ BINMODE?=555
BINDIR= /usr/bin
MAN= newaliases.8
-SRCS= newaliases.c aliases.c map.c log.c
+SRCS= newaliases.c aliases.c map.c log.c util.c
LDFLAGS= -lutil
.include <bsd.prog.mk>