diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-21 12:18:19 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-06-22 10:57:29 +0100 |
commit | 300acf008d6d194f0107e293a20cfb88611546e9 (patch) | |
tree | a7706600533bbdb32efcfe6078b6a5ae330f3ec5 /contrib/librdns | |
parent | b862f3717beee6bf735cfd89a51f41440b26bd0c (diff) | |
download | rspamd-300acf008d6d194f0107e293a20cfb88611546e9.tar.gz rspamd-300acf008d6d194f0107e293a20cfb88611546e9.zip |
[Test] Fix functional tests
Diffstat (limited to 'contrib/librdns')
-rw-r--r-- | contrib/librdns/punycode.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/contrib/librdns/punycode.c b/contrib/librdns/punycode.c index 909d0d940..61091b2e4 100644 --- a/contrib/librdns/punycode.c +++ b/contrib/librdns/punycode.c @@ -33,7 +33,7 @@ */ #include "dns_private.h" -static const unsigned base = 36; +static const unsigned event_loop = 36; static const unsigned t_min = 1; static const unsigned t_max = 26; static const unsigned skew = 38; @@ -61,11 +61,11 @@ adapt (unsigned int delta, unsigned int numpoints, int first) } delta += delta / numpoints; k = 0; - while (delta > ((base - t_min) * t_max) / 2) { - delta /= base - t_min; - k += base; + while (delta > ((event_loop - t_min) * t_max) / 2) { + delta /= event_loop - t_min; + k += event_loop; } - return k + (((base - t_min + 1) * delta) / (delta + skew)); + return k + (((event_loop - t_min + 1) * delta) / (delta + skew)); } /** @@ -139,7 +139,7 @@ rdns_punycode_label_toascii (const uint32_t *in, size_t in_len, char *out, else if (in[i] == n) { unsigned int q = delta; unsigned int k; - for (k = base;; k += base) { + for (k = event_loop;; k += event_loop) { unsigned int t; if (k <= bias) { t = t_min; @@ -156,8 +156,8 @@ rdns_punycode_label_toascii (const uint32_t *in, size_t in_len, char *out, if (o >= *out_len) { return -1; } - out[o++] = digit (t + ((q - t) % (base - t))); - q = (q - t) / (base - t); + out[o++] = digit (t + ((q - t) % (event_loop - t))); + q = (q - t) / (event_loop - t); } if (o >= *out_len) { return -1; |