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/srsreverse.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'src/srsreverse.c') diff --git a/src/srsreverse.c b/src/srsreverse.c index 33d0e5a..6c87fb2 100644 --- a/src/srsreverse.c +++ b/src/srsreverse.c @@ -25,6 +25,7 @@ void die_nomem() { logmsg(WHO, 111, FATAL, "out of memory"); } + void die_control() { logmsg(WHO, 110, FATAL, "Unable to read control files"); @@ -40,14 +41,14 @@ struct constmap mapsrsdomains; stralloc srserror = {0}; stralloc srshost = {0}; -/** @file srsreverse.c - @brief forwarding bounces 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 srsreverse.c + @brief forwarding bounces 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(); @@ -105,12 +106,13 @@ int main() } j = str_len(host); - for (i = 0; i <= j; ++i) + for (i = 0; i <= j; ++i) { if ((i == 0) || (host[i] == '.')) { if (!stralloc_copys(&srshost, "")) die_nomem(); if (!stralloc_catb(&srshost, host + i, j - i)) die_nomem(); if ((srsdomaininfo = constmap(&mapvdomains, srshost.s, srshost.len)) != 0) goto SRSDOMAINS; } + } if (!stralloc_copys(&srshost, host)) die_nomem(); SRSDOMAINS: -- cgit v1.2.3