aboutsummaryrefslogtreecommitdiffstats
path: root/smtpd/makemap.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@poolp.org>2012-11-15 20:30:22 +0100
committerGilles Chehade <gilles@poolp.org>2012-11-15 20:30:22 +0100
commit9b31b68eac9b573428f11bd93fc3604e5ee97907 (patch)
tree57943bdcf4d0b3fdb8842d5d6c4aa6c6d87bb5b4 /smtpd/makemap.c
parentremove deprecated API (diff)
parentfinish KNF (diff)
downloadOpenSMTPD-9b31b68eac9b573428f11bd93fc3604e5ee97907.tar.xz
OpenSMTPD-9b31b68eac9b573428f11bd93fc3604e5ee97907.zip
Merge branch 'cleanup'
Conflicts: smtpd/lka.c smtpd/smtpd.h smtpd/table_db.c smtpd/table_static.c
Diffstat (limited to 'smtpd/makemap.c')
-rw-r--r--smtpd/makemap.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/smtpd/makemap.c b/smtpd/makemap.c
index d9c113e2..969a7469 100644
--- a/smtpd/makemap.c
+++ b/smtpd/makemap.c
@@ -151,15 +151,18 @@ main(int argc, char *argv[])
p = strstr(argv[1], ".db");
if (p == NULL || strcmp(p, ".db") != 0) {
- if (! bsnprintf(dbname, sizeof dbname, "%s.db", argv[1]))
+ if (! bsnprintf(dbname, sizeof dbname, "%s.db",
+ argv[1]))
errx(1, "database name too long");
}
else {
- if (strlcpy(dbname, argv[1], sizeof dbname) >= sizeof dbname)
+ if (strlcpy(dbname, argv[1], sizeof dbname)
+ >= sizeof dbname)
errx(1, "database name too long");
}
- execlp(execname, execname, "-d", argv[0], "-o", dbname, "-", NULL);
+ execlp(execname, execname, "-d", argv[0], "-o", dbname, "-",
+ NULL);
err(1, "execlp");
}
@@ -197,7 +200,8 @@ main(int argc, char *argv[])
if (strcmp(source, "-") != 0)
if (fchmod(db->fd(db), sb.st_mode) == -1 ||
fchown(db->fd(db), sb.st_uid, sb.st_gid) == -1) {
- warn("couldn't carry ownership and perms to %s", dbname);
+ warn("couldn't carry ownership and perms to %s",
+ dbname);
goto bad;
}
@@ -364,7 +368,7 @@ parse_setentry(char *line, size_t len, size_t lineno)
if (db->put(db, &key, &val, 0) == -1) {
warn("dbput");
return 0;
- }
+ }
dbputs++;
@@ -384,9 +388,9 @@ int
make_aliases(DBT *val, char *text)
{
struct expandnode xn;
- char *subrcpt;
- char *endp;
- char *origtext;
+ char *subrcpt;
+ char *endp;
+ char *origtext;
val->data = NULL;
val->size = 0;
@@ -448,7 +452,7 @@ usage(void)
if (mode == P_NEWALIASES)
fprintf(stderr, "usage: %s [-f file]\n", __progname);
else
- fprintf(stderr, "usage: %s [-d dbtype] [-o dbfile] [-t type] file\n",
- __progname);
+ fprintf(stderr, "usage: %s [-d dbtype] [-o dbfile] "
+ "[-t type] file\n", __progname);
exit(1);
}