From 0f33fa7ea5170f4eae33209e1dd0acae9495edc1 Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Mon, 24 Aug 2015 16:25:00 +0200 Subject: mds-echo: style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/mds-echo.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/mds-echo.c b/src/mds-echo.c index c434656..fa2ed53 100644 --- a/src/mds-echo.c +++ b/src/mds-echo.c @@ -304,20 +304,14 @@ int echo_message(void) /* Validate headers. */ if ((recv_client_id == NULL) || (strequals(recv_client_id, "0:0"))) - { - eprint("received message from anonymous sender, ignoring."); - return 0; - } + return eprint("received message from anonymous sender, ignoring."), 0; else if (recv_message_id == NULL) - { - eprint("received message without ID, ignoring, master server is misbehaving."); - return 0; - } + return eprint("received message without ID, ignoring, master server is misbehaving."), 0; /* Construct echo message headers. */ - n = 1 + strlen("To: \nIn response to: \nMessage ID: \n\n"); - n += strlen(recv_client_id) + strlen(recv_message_id) + 2 * sizeof(int32_t) + sizeof(uint32_t); + n = sizeof("To: \nIn response to: \nMessage ID: \n\n") / sizeof(char); + n += strlen(recv_client_id) + strlen(recv_message_id) + 3 * sizeof(uint32_t); if (recv_length != NULL) n += strlen(recv_length) + 1; -- cgit v1.2.3-70-g09d2