Remove duplicated checks
Signed-off-by: Adrien Gallouët <adrien@gallouet.fr>
This commit is contained in:
7
mud.c
7
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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user