]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-mail: decode_hex_*() - Rename functions and remove leading underscores
authorMarco Bettini <marco.bettini@open-xchange.com>
Thu, 15 Jan 2026 14:25:07 +0000 (14:25 +0000)
committerMarco Bettini <marco.bettini@open-xchange.com>
Mon, 19 Jan 2026 08:21:39 +0000 (08:21 +0000)
src/lib-mail/rfc2231-parser.c

index 2635a9a80c7ddbcf14f427b194ebab524ad82206..6e989aadfbe7fdc78df0f2986d85fea582f2bb41 100644 (file)
@@ -47,7 +47,7 @@
    them. So this implementation does a best-effort "garbage-in garbage-out" sort
    of thing. */
 
-static inline int _decode_hex_digit(const unsigned char digit)
+static inline int decode_hex_digit(const unsigned char digit)
 {
        if (digit >= '0' && digit <= '9')
                return digit - '0';
@@ -58,15 +58,15 @@ static inline int _decode_hex_digit(const unsigned char digit)
        return -1;
 }
 
-static inline bool _decode_percent_encoding(const unsigned char digit_a,
-                                           const unsigned char digit_b,
-                                           unsigned char *result_r)
+static inline bool decode_hex_byte(const unsigned char digit_a,
+                                  const unsigned char digit_b,
+                                  unsigned char *result_r)
 {
-       int decoded = _decode_hex_digit(digit_a);
+       int decoded = decode_hex_digit(digit_a);
        if (decoded < 0)
                return FALSE;
        *result_r = decoded;
-       decoded = _decode_hex_digit(digit_b);
+       decoded = decode_hex_digit(digit_b);
        if (decoded < 0)
                return FALSE;
        *result_r = (*result_r << 4) + decoded;
@@ -83,7 +83,7 @@ static string_t *rfc2231_decode_value(const char *value)
                str_append_data(str, plast, (p - plast));
                unsigned char ch;
                if (*(p+1) == '\0' || *(p+2) == '\0' ||
-                   !_decode_percent_encoding(*(p+1), *(p+2), &ch))
+                   !decode_hex_byte(*(p+1), *(p+2), &ch))
                        return NULL;
                plast = p + 3;
                str_append_data(str, &ch, 1);