on reviewing runedecompose, the idea that one could put a non-bmp rune in the even half of the __decompose2 table if it decomposed to two bmp runes requires pre-knowledge of this fact when searching. so remove that possiblity from the code. Reference: /n/atom/patch/applied2013/runedctidy Date: Mon Jun 24 17:19:02 CES 2013 Signed-off-by: quanstro@quanstro.net --- /sys/src/libc/port/runedecompose.c Mon Jun 24 17:14:57 2013 +++ /sys/src/libc/port/runedecompose.c Mon Jun 24 17:14:57 2013 @@ -56,11 +56,13 @@ return 0; } } - q = bsearch64(a, __decompose264, nelem(__decompose264)/2, 2); - if(q){ - d[0] = q[1] >> 32; - d[1] = q[1] & 0xfffffff; - return 0; + else{ + q = bsearch64(a, __decompose264, nelem(__decompose264)/2, 2); + if(q){ + d[0] = q[1] >> 32; + d[1] = q[1] & 0xfffffff; + return 0; + } } return -1; }