-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* convert is_invalid_argument to check_args * update test
- Loading branch information
Showing
5 changed files
with
28 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/10 12:37:54 by reasuke #+# #+# */ | ||
/* Updated: 2024/01/12 16:02:39 by reasuke ### ########.fr */ | ||
/* Updated: 2024/01/15 13:19:05 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -23,7 +23,7 @@ | |
|
||
# include "../libft/libft.h" | ||
|
||
bool is_invalid_argument(int argc, char **argv); | ||
int check_args(int argc, char **argv); | ||
|
||
t_list *generate_stack(int argc, char **argv); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
/* ************************************************************************** */ | ||
/* */ | ||
/* ::: :::::::: */ | ||
/* is_invalid_argument.c :+: :+: :+: */ | ||
/* check_args.c :+: :+: :+: */ | ||
/* +:+ +:+ +:+ */ | ||
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/11 14:44:55 by reasuke #+# #+# */ | ||
/* Updated: 2024/01/11 18:16:19 by reasuke ### ########.fr */ | ||
/* Updated: 2024/01/15 13:18:39 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -64,9 +64,11 @@ static bool _has_duplicate(int argc, char **argv) | |
return (false); | ||
} | ||
|
||
bool is_invalid_argument(int argc, char **argv) | ||
int check_args(int argc, char **argv) | ||
{ | ||
return (_has_not_digit(argc, argv) | ||
if (_has_not_digit(argc, argv) | ||
|| _has_overflow(argc, argv) | ||
|| _has_duplicate(argc, argv)); | ||
|| _has_duplicate(argc, argv)) | ||
exit_with_error(); | ||
return (0); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
/* By: reasuke <[email protected]> +#+ +:+ +#+ */ | ||
/* +#+#+#+#+#+ +#+ */ | ||
/* Created: 2024/01/10 12:37:36 by reasuke #+# #+# */ | ||
/* Updated: 2024/01/15 12:04:04 by reasuke ### ########.fr */ | ||
/* Updated: 2024/01/15 13:04:27 by reasuke ### ########.fr */ | ||
/* */ | ||
/* ************************************************************************** */ | ||
|
||
|
@@ -35,10 +35,7 @@ int main(int argc, char **argv) | |
{ | ||
t_list *stack_a; | ||
|
||
if (argc < 2) | ||
return (0); | ||
if (is_invalid_argument(argc, argv)) | ||
exit_with_error(); | ||
check_args(argc, argv); | ||
stack_a = generate_stack(argc, argv); | ||
if (argc < 5) | ||
nano_sort(stack_a, argc); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters