summaryrefslogtreecommitdiff
path: root/input_handling.c
diff options
context:
space:
mode:
authorDominik Kaiser2024-04-13 14:59:17 +0200
committerDominik Kaiser2024-04-13 14:59:17 +0200
commit8d2fe088d72dfebfc96e7bd9b1eae9b3e02f804a (patch)
treec05f200c2359041ced4ae8f491dae97572ba2022 /input_handling.c
parentabc12d29679ae6049c9cacbf09a897529377d79c (diff)
downloadpush_swap-8d2fe088d72dfebfc96e7bd9b1eae9b3e02f804a.tar.gz
push_swap-8d2fe088d72dfebfc96e7bd9b1eae9b3e02f804a.zip
Fix input handling
Before the fix, the last element was ignored while checking for duplicates. Now all elements are checked and input handling should be working fine.
Diffstat (limited to 'input_handling.c')
-rw-r--r--input_handling.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/input_handling.c b/input_handling.c
index 93e37f6..7699671 100644
--- a/input_handling.c
+++ b/input_handling.c
@@ -6,7 +6,7 @@
/* By: dkaiser <dkaiser@student.42heilbronn.de +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/04/12 17:31:49 by dkaiser #+# #+# */
-/* Updated: 2024/04/12 18:49:38 by dkaiser ### ########.fr */
+/* Updated: 2024/04/13 14:58:42 by dkaiser ### ########.fr */
/* */
/* ************************************************************************** */
@@ -43,7 +43,7 @@ static int are_numbers_unique(t_list *stack)
while (stack->next)
{
cmp_elem = stack->next;
- while (cmp_elem->next)
+ while (cmp_elem)
{
if (*(int *)stack->content == *(int *)cmp_elem->content)
return (0);