From: Marco Bettini Date: Thu, 15 Jan 2026 14:25:07 +0000 (+0000) Subject: lib-mail: decode_hex_*() - Rename functions and remove leading underscores X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aec29451d1402c0247d292e652c92468b151b28f;p=thirdparty%2Fdovecot%2Fcore.git lib-mail: decode_hex_*() - Rename functions and remove leading underscores --- diff --git a/src/lib-mail/rfc2231-parser.c b/src/lib-mail/rfc2231-parser.c index 2635a9a80c..6e989aadfb 100644 --- a/src/lib-mail/rfc2231-parser.c +++ b/src/lib-mail/rfc2231-parser.c @@ -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);