From bd4a11f73cc677f581bc47744b7c3751aebc8afd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Mon, 12 Dec 2016 16:40:04 +0000 Subject: [PATCH] Reformat --- mud.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mud.c b/mud.c index 7daf5d0..e1e3bf8 100644 --- a/mud.c +++ b/mud.c @@ -4,19 +4,21 @@ #define __APPLE_USE_RFC_3542 #endif -#include #include #include #include -#include #include #include +#include +#include + #include #include #include + +#include #include -#include -#include +#include #include @@ -975,13 +977,14 @@ mud_packet_check_size(unsigned char *data, size_t size) if (size <= MUD_PACKET_SIZE(0)) return -1; + // clang-format off const size_t sizes[] = { [mud_kiss] = MUD_PACKET_SIZE(sizeof(packet->data.kiss)), [mud_stat] = MUD_PACKET_SIZE(sizeof(packet->data.stat)), [mud_keyx] = MUD_PACKET_SIZE(sizeof(packet->data.public)), [mud_mtux] = MUD_PACKET_SIZE(sizeof(packet->data.mtu)), [mud_bakx] = MUD_PACKET_SIZE(sizeof(packet->data.backup)), - }; + }; // clang-format on return (packet->hdr.code >= sizeof(sizes)) || (sizes[packet->hdr.code] != size); @@ -999,8 +1002,7 @@ mud_packet_check(struct mud *mud, unsigned char *data, size_t size) .size = MUD_MAC_SIZE, }, .ad = { - .data = data, - .size = size - MUD_MAC_SIZE, + .data = data, .size = size - MUD_MAC_SIZE, }, };