summaryrefslogtreecommitdiff
path: root/src/srsforward.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/srsforward.c')
-rw-r--r--src/srsforward.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/srsforward.c b/src/srsforward.c
index c855d36..0477d90 100644
--- a/src/srsforward.c
+++ b/src/srsforward.c
@@ -23,6 +23,7 @@ void die_nomem()
{
logmsg(WHO, 111, FATAL, "out of memory");
}
+
void die_control()
{
logmsg(WHO, 110, FATAL, "Unable to read control files");
@@ -35,14 +36,14 @@ struct constmap mapsrsdomains;
stralloc srshost = {0};
stralloc srserror = {0};
-/** @file srsforward.c
- @brief forwarding mails with SRS enhanced addresss
- @return 0 on success (forwarded or not)
- -3 SRS error with error output
- 111 no memory / processing error
- 110 control file not readable
+/**
+ @file srsforward.c
+ @brief forwarding mails with SRS enhanced addresss
+ @return 0 on success (forwarded or not)
+ -3 SRS error with error output
+ 111 no memory / processing error
+ 110 control file not readable
*/
-
static int srserror_str(int code)
{
if (!stralloc_copys(&srserror, "SRS: ")) die_nomem();
@@ -128,13 +129,16 @@ int main(int argc, char **argv)
if (sendhost[j - 1] == '.') {
if (!stralloc_copys(&srshost, sendhost)) die_nomem();
if (!stralloc_cats(&srshost, host)) die_nomem();
- } else if (!stralloc_copys(&srshost, sendhost))
+ } else if (!stralloc_copys(&srshost, sendhost)) {
die_nomem();
- } else if (!stralloc_copys(&srshost, host))
+ }
+ } else if (!stralloc_copys(&srshost, host)) {
die_nomem();
+ }
if (!stralloc_0(&srshost)) die_nomem();
- } else
+ } else {
die_control();
+ }
/* Let's go SRS rewrite */