Make this pass the test cases again.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22620 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-02-23 10:58:43 +00:00
parent 7c391f0586
commit b8a771bf3b

View File

@@ -108,22 +108,20 @@ wind_punycode_label_toascii(const uint32_t *in, size_t in_len,
out[o++] = in[i];
}
}
if (o == i) {
*out_len = o;
return 0;
}
b = h;
if (b > 0) {
if (o >= *out_len)
return WIND_ERR_OVERRUN;
out[o++] = 0x2D;
}
if (o + 4 >= *out_len)
return WIND_ERR_OVERRUN;
memmove(out + 4, out, o);
memcpy(out, "xn--", 4);
o += 4;
/* is this string punycoded */
if (h < in_len) {
if (o + 4 >= *out_len)
return WIND_ERR_OVERRUN;
memmove(out + 4, out, o);
memcpy(out, "xn--", 4);
o += 4;
}
while (h < in_len) {
m = (unsigned)-1;