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'); } /*