From 20b85c03e751b4876fa3c92040464e483172b746 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Wed, 3 Jul 2024 19:03:11 +0200 Subject: manual format adjustment --- src/qmail-newu.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/qmail-newu.c') diff --git a/src/qmail-newu.c b/src/qmail-newu.c index f2e33cd..ee836bb 100644 --- a/src/qmail-newu.c +++ b/src/qmail-newu.c @@ -17,36 +17,41 @@ #define WHO "qmail-newu" -int rename(const char *, const char *); // stdio.h - void die_chdir() { logmsg(WHO, 110, ERROR, "unable to chdir"); } + void die_nomem() { logmsg(WHO, 111, FATAL, "fatal: out of memory"); } + void die_opena() { logmsg(WHO, 112, ERROR, "unable to open users/assign"); } + void die_reada() { logmsg(WHO, 110, ERROR, "unable to read users/assign"); } + void die_format() { logmsg(WHO, 112, ERROR, "bad format in users/assign"); } + void die_opent() { logmsg(WHO, 112, ERROR, "unable to open users/assign.cdb.tmp"); } + void die_writet() { logmsg(WHO, 112, ERROR, "unable to write users/assign.cdb.tmp"); } + void die_rename() { logmsg(WHO, 112, ERROR, "unable to move users/cdb.tmp to users/assign.cdb"); @@ -112,11 +117,12 @@ int main() if (!stralloc_copyb(&data, line.s + i + 1, line.len - i - 1)) die_nomem(); numcolons = 0; - for (i = 0; i < data.len; ++i) + for (i = 0; i < data.len; ++i) { if (data.s[i] == ':') { data.s[i] = 0; if (++numcolons == 6) break; } + } if (numcolons < 6) die_format(); data.len = i; -- cgit v1.2.3