int i, j;
unsigned int i, j;
race_decode_decompress(const char *from, unsigned short *buf, size_t buflen){	unsigned short *p = buf;	unsigned int bitbuf = 0;	int bitlen = 0;	int i, j;	size_t len;	while (*from != '\0') {		int c = *from++;		int x;		if ('a' <= c && c <= 'z')			x = c - 'a';		else if ('A' <= c && c <= 'Z')			x = c - 'A';		else if ('2' <= c && c <= '7')			x = c - '2' + 26;		else			return (idn_invalid_encoding);		bitbuf = (bitbuf << 5) + x;		bitlen += 5;		if (bitlen >= 8) {			*p++ = (bitbuf >> (bitlen - 8)) & 0xff;			bitlen -= 8;		}	}	len = p - buf;	/*	 * Now 'buf' holds the decoded string.	 */	/*	 * Decompress.	 */	if (buf[0] == RACE_2OCTET_MODE) {		if ((len - 1) % 2 != 0)			return (idn_invalid_encoding);		for (i = 1, j = 0; i < len; i += 2, j++)			buf[j] = (buf[i] << 8) + buf[i + 1];		len = j;	} else {		unsigned short c = buf[0] << 8;	/* higher octet */		for (i = 1, j = 0; i < len; j++) {			if (buf[i] == RACE_ESCAPE) {				if (i + 1 >= len)					return (idn_invalid_encoding);				else if (buf[i + 1] == RACE_ESCAPE_2ND)					buf[j] = c | 0xff;				else					buf[j] = buf[i + 1];				i += 2;			} else if (buf[i] == 0x99 && c == 0x00) {				/*				 * The RACE specification says this is error.				 */				return (idn_invalid_encoding);				 			} else {				buf[j] = c | buf[i++];			}		}		len = j;	}	buf[len] = '\0';	return (idn_success);}