From 5b9b3d57095cc2c34f1db744f72fa1b9bff7f87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Thu, 16 Aug 2018 12:58:46 +0000 Subject: [PATCH] Remove duplicated checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- mud.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mud.c b/mud.c index 3a0cdda..59dd931 100644 --- a/mud.c +++ b/mud.c @@ -1467,15 +1467,10 @@ mud_send(struct mud *mud, const void *data, size_t size, unsigned tc) if (!size || !mud->count) return 0; - if (size > sizeof(packet) - MUD_PACKET_MIN_SIZE) { - errno = EMSGSIZE; - return -1; - } - const int packet_size = mud_encrypt(mud, now, packet, sizeof(packet), data, size); if (!packet_size) { - errno = EINVAL; + errno = EMSGSIZE; return -1; }