Replacing use of strstr to strchr for performance reasons

Thanks to @smalyshev for the tip.