Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

since there are only ascii chars in the whitelist you could just declare an array of size 256 (doesn't really matter if it's a bitvector or char array, int array or whatever) and replace in WHITELIST by

    return (CHAR_MAP_ARRAY[c] = 'y')
Any UTF-8 start or follow byte shoudl be > 128 where there should always be values indicating false


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: