「🔨」 fix(Phonebook): Fixed overflow and invalid command
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/26 00:20:32 by adjoly #+# #+# */
|
/* Created: 2024/10/26 00:20:32 by adjoly #+# #+# */
|
||||||
/* Updated: 2024/11/03 18:50:17 by adjoly ### ########.fr */
|
/* Updated: 2024/11/04 10:43:35 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -29,10 +29,6 @@ PhoneBook::PhoneBook(void) {
|
|||||||
this->_search();
|
this->_search();
|
||||||
else if (!input.compare("EXIT"))
|
else if (!input.compare("EXIT"))
|
||||||
return ;
|
return ;
|
||||||
else if (input.empty())
|
|
||||||
continue ;
|
|
||||||
else
|
|
||||||
std::cout << "Not a valid command" << std::endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/10/31 13:51:00 by adjoly #+# #+# */
|
/* Created: 2024/10/31 13:51:00 by adjoly #+# #+# */
|
||||||
/* Updated: 2024/11/03 18:06:18 by adjoly ### ########.fr */
|
/* Updated: 2024/11/04 10:43:18 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -47,6 +47,6 @@ void PhoneBook::_add(void) {
|
|||||||
return ;
|
return ;
|
||||||
this->_contact[this->_index].setSecret(input);
|
this->_contact[this->_index].setSecret(input);
|
||||||
this->_index++;
|
this->_index++;
|
||||||
if (this->_index >= 8)
|
if (this->_index > 7)
|
||||||
this->_index = 0;
|
this->_index = 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user