Use strchr(3) instead of index(3) since it is POSIX compliant and not