From a6f36af0db13198afc6af17a27fec0561a180d91 Mon Sep 17 00:00:00 2001 From: Jannis Hoffmann Date: Sun, 14 Jul 2024 13:34:29 +0200 Subject: clang format fixes --- .clang-format | 2 +- src/qmail-pw2u.c | 2 +- tests/openssl_get_subj_alt_dns.c | 39 ++++++++++++++++++++------------------- 3 files changed, 22 insertions(+), 21 deletions(-) diff --git a/.clang-format b/.clang-format index fde5d8f..cae18c8 100644 --- a/.clang-format +++ b/.clang-format @@ -117,7 +117,7 @@ IncludeCategories: Priority: 6 SortPriority: 0 CaseSensitive: true - - Regex: '^$' + - Regex: '^$' Priority: 5 SortPriority: 0 CaseSensitive: true diff --git a/src/qmail-pw2u.c b/src/qmail-pw2u.c index 0be600a..5edb376 100644 --- a/src/qmail-pw2u.c +++ b/src/qmail-pw2u.c @@ -5,8 +5,8 @@ #include "buffer.h" #include "byte.h" #include "constmap.h" -#include "exit.h" #include "error.h" +#include "exit.h" #include "getln.h" #include "getoptb.h" #include "open.h" diff --git a/tests/openssl_get_subj_alt_dns.c b/tests/openssl_get_subj_alt_dns.c index 29cd111..00969aa 100644 --- a/tests/openssl_get_subj_alt_dns.c +++ b/tests/openssl_get_subj_alt_dns.c @@ -33,25 +33,26 @@ int main() const GENERAL_NAME *current_name = sk_GENERAL_NAME_value(san, i); switch (current_name->type) { - case GEN_DNS: - printf("DNS: %s\n", ASN1_STRING_get0_data(current_name->d.dNSName)); - break; - case GEN_EMAIL: - printf("Email: %s\n", ASN1_STRING_get0_data(current_name->d.rfc822Name)); - break; - case GEN_URI: - printf("URI: %s\n", ASN1_STRING_get0_data(current_name->d.uniformResourceIdentifier)); - break; - case GEN_IPADD: - int len = ASN1_STRING_length(current_name->d.iPAddress); - if (len != 4) { - fprintf(stderr, "Length mismatch in ip\n"); - return 1; - } - const unsigned char *data = ASN1_STRING_get0_data(current_name->d.iPAddress); - printf("IP Address: %d.%d.%d.%d\n", data[0], data[1], data[2], data[3]); - break; - // Add more types if needed + case GEN_DNS: + // these are alternative host names + printf("DNS: %s\n", ASN1_STRING_get0_data(current_name->d.dNSName)); + break; + case GEN_EMAIL: + printf("Email: %s\n", ASN1_STRING_get0_data(current_name->d.rfc822Name)); + break; + case GEN_URI: + printf("URI: %s\n", ASN1_STRING_get0_data(current_name->d.uniformResourceIdentifier)); + break; + case GEN_IPADD: + int len = ASN1_STRING_length(current_name->d.iPAddress); + if (len != 4) { + fprintf(stderr, "Length mismatch in ip\n"); + return 1; + } + const unsigned char *data = ASN1_STRING_get0_data(current_name->d.iPAddress); + printf("IP Address: %d.%d.%d.%d\n", data[0], data[1], data[2], data[3]); + break; + // Add more types if needed } } GENERAL_NAMES_free(san); -- cgit v1.2.3