Use strchr instead of index (which was only standard in 4.3 BSD).