From f0e1ac59d863f03a90d7db204f468e3dca4b6e0e Mon Sep 17 00:00:00 2001 From: Agathiyan Bragadeesh Date: Mon, 24 Jul 2023 16:43:36 +0100 Subject: [PATCH] Rewrite nibble_to_hex_digit for readability Signed-off-by: Agathiyan Bragadeesh --- library/x509.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/x509.c b/library/x509.c index b8a866ac3..b36e27a27 100644 --- a/library/x509.c +++ b/library/x509.c @@ -812,7 +812,7 @@ int mbedtls_x509_get_ext(unsigned char **p, const unsigned char *end, static char nibble_to_hex_digit(int i) { - return (i < 10) ? (i | 0x30) : ((i - 9) | 0x40); + return (i < 10) ? (i + '0') : (i - 10 + 'A'); } /*