diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-08-24 16:25:00 +0200 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-08-24 16:25:00 +0200 |
commit | 0f33fa7ea5170f4eae33209e1dd0acae9495edc1 (patch) | |
tree | 1329b4b79ba16004f30e89dcbe727e83f6d10556 /src | |
parent | mds-respawn: typo + mds-kkbd: doc, derp, and minimise some buffer sizes (diff) | |
download | mds-0f33fa7ea5170f4eae33209e1dd0acae9495edc1.tar.gz mds-0f33fa7ea5170f4eae33209e1dd0acae9495edc1.tar.bz2 mds-0f33fa7ea5170f4eae33209e1dd0acae9495edc1.tar.xz |
mds-echo: style
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mds-echo.c | 14 |
1 files changed, 4 insertions, 10 deletions
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; |