X-Git-Url: https://git.ozlabs.org/?p=ccan;a=blobdiff_plain;f=ccan%2Fcharset%2Ftest%2Frun.c;h=5504e886b9f9f111a9554aa5dfb70cfce42b96c2;hp=9f3f90073dc0624e7bcfc064f56c849dfff6ce94;hb=455572f3e5a66e8a02f38458524fad651eb46489;hpb=eefefbaee15ea270992c958f6a9b145cdc017e44 diff --git a/ccan/charset/test/run.c b/ccan/charset/test/run.c index 9f3f9007..5504e886 100644 --- a/ccan/charset/test/run.c +++ b/ccan/charset/test/run.c @@ -40,7 +40,8 @@ static unsigned int utf8_randcode(int len) case 3: for (;;) { ret = r % (0x10000-0x800) + 0x800; - if (!utf8_allow_surrogates && ret >= 0xD800 && ret <= 0xDFFF) + if ((!utf8_allow_surrogates && ret >= 0xD800 && ret <= 0xDFFF) + || ret >= 0xFFFE) { r = rand32(); continue;