From c2d13700ac8bfbda6cefbd3868be78e1f3d53c62 Mon Sep 17 00:00:00 2001 From: Gustavo Garcia Date: Fri, 19 Apr 2024 17:08:49 +0200 Subject: [PATCH] Fix clang-format lint warnings --- src/apps/relay/mainrelay.c | 9 +++++---- src/apps/relay/mainrelay.h | 2 +- src/server/ns_turn_server.c | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/apps/relay/mainrelay.c b/src/apps/relay/mainrelay.c index 11aaade..396b124 100644 --- a/src/apps/relay/mainrelay.c +++ b/src/apps/relay/mainrelay.c @@ -1778,10 +1778,11 @@ unsigned char *base64decode(const void *b64_decode_this, int decode_this_many_by int decoded_byte_index = 0; // Index where the next base64_decoded byte should be written. while (0 < BIO_read(b64_bio, base64_decoded + decoded_byte_index, 1)) { // Read byte-by-byte. decoded_byte_index++; // Increment the index until read of BIO decoded data is complete. - } // Once we're done reading decoded data, BIO_read returns -1 even though there's no error. - BIO_free_all(b64_bio); // Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). - return base64_decoded; // Returns base-64 decoded data with trailing null terminator. + } // Once we're done reading decoded data, BIO_read returns -1 even though there's no error. + BIO_free_all(b64_bio); // Destroys all BIOs in chain, starting with b64 (i.e. the 1st one). + return base64_decoded; // Returns base-64 decoded data with trailing null terminator. } + int decodedTextSize(char *input) { int i = 0; int result = 0, padding = 0; @@ -1794,8 +1795,8 @@ int decodedTextSize(char *input) { result = (strlen(input) / 4 * 3) - padding; return result; } -void decrypt_aes_128(char *in, const unsigned char *mykey) { +void decrypt_aes_128(char *in, const unsigned char *mykey) { unsigned char iv[8] = {0}; AES_KEY key; unsigned char outdata[256]; diff --git a/src/apps/relay/mainrelay.h b/src/apps/relay/mainrelay.h index 11161f1..03f8c95 100644 --- a/src/apps/relay/mainrelay.h +++ b/src/apps/relay/mainrelay.h @@ -28,7 +28,7 @@ * SUCH DAMAGE. */ -#if !defined(__MAIN_RELAY__) +#ifndef __MAIN_RELAY__ #define __MAIN_RELAY__ #include diff --git a/src/server/ns_turn_server.c b/src/server/ns_turn_server.c index 002e9d0..7eee05c 100644 --- a/src/server/ns_turn_server.c +++ b/src/server/ns_turn_server.c @@ -4792,8 +4792,9 @@ static void peer_input_handler(ioa_socket_handle s, int event_type, ioa_net_data turn_report_session_usage(ss, 0); allocation *a = get_allocation_ss(ss); - if (!is_allocation_valid(a)) + if (!is_allocation_valid(a)) { return; + } uint16_t chnum = 0;