Fix null terminator search