diff --git a/d00/ex01/PhoneBook.class.cpp b/d00/ex01/PhoneBook.class.cpp index b2712ea..01fbd46 100644 --- a/d00/ex01/PhoneBook.class.cpp +++ b/d00/ex01/PhoneBook.class.cpp @@ -133,7 +133,7 @@ void PhoneBook::search_contact() { if (!std::getline(std::cin, index)) return; id = std::strtol(index.c_str(), &ret, 10); - if (*ret || id < 0 || id > this->_contact_count - 1 || id > 7) + if (*ret || index.empty() || id < 0 || id > _contact_count - 1 || id > 7) std::cout << B_RED "sorry, not a valid index" RESET << std::endl; else break; diff --git a/d00/ex01/phonebook b/d00/ex01/phonebook new file mode 100755 index 0000000..1fad1cd Binary files /dev/null and b/d00/ex01/phonebook differ