30 lines
1.1 KiB
Diff
30 lines
1.1 KiB
Diff
--- a/lib/punycode.c 2016-01-14 21:42:33.000000000 +0800
|
|
+++ b/lib/punycode.c 2018-01-12 11:36:58.027226633 +0800
|
|
@@ -88,11 +88,11 @@ enum
|
|
/* point (for use in representing integers) in the range 0 to */
|
|
/* base-1, or base if cp does not represent a value. */
|
|
|
|
-static punycode_uint
|
|
-decode_digit (punycode_uint cp)
|
|
+static unsigned
|
|
+decode_digit (int cp)
|
|
{
|
|
- return cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 :
|
|
- cp - 97 < 26 ? cp - 97 : base;
|
|
+ return (unsigned) (cp - 48 < 10 ? cp - 22 : cp - 65 < 26 ? cp - 65 :
|
|
+ cp - 97 < 26 ? cp - 97 : base);
|
|
}
|
|
|
|
/* encode_digit(d,flag) returns the basic code point whose value */
|
|
--- a/tests/tst_idna.c 2016-01-14 21:42:33.000000000 +0800
|
|
+++ b/tests/tst_idna.c 2018-01-12 11:36:58.027226633 +0800
|
|
@@ -211,7 +211,7 @@ static const struct idna idna[] = {
|
|
'x', 'n', '-', '-', 'f', 'o', 0x3067},
|
|
IDNA_ACE_PREFIX "too long too long too long too long too long too "
|
|
"long too long too long too long too long ", 0,
|
|
- IDNA_CONTAINS_ACE_PREFIX, IDNA_PUNYCODE_ERROR}
|
|
+ IDNA_CONTAINS_ACE_PREFIX, IDNA_INVALID_LENGTH}
|
|
};
|
|
|
|
void
|