Fix ft_mat_fill by swapping rows and columns
authorLukas Jiriste <ljiriste@student.42prague.com>
Fri, 12 Apr 2024 15:27:05 +0000 (17:27 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Mon, 6 May 2024 19:01:22 +0000 (21:01 +0200)
ft_arr/ft_mat_fill.c

index b8bc4e9be672b187c958deb5a273443984e19550..bafe399c1e86b13eb9db868ef0e648f3a7edb729 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: ljiriste <ljiriste@student.42prague.com>   +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2024/04/05 10:00:33 by ljiriste          #+#    #+#             */
-/*   Updated: 2024/04/05 10:07:19 by ljiriste         ###   ########.fr       */
+/*   Updated: 2024/04/12 16:14:36 by ljiriste         ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -19,10 +19,10 @@ t_arr_stat  ft_mat_fill(t_mat *mat, void *filler)
        size_t  j;
 
        i = 0;
-       while (i < mat->cols)
+       while (i < mat->rows)
        {
                j = 0;
-               while (j < mat->rows)
+               while (j < mat->cols)
                {
                        ft_memcpy(ft_mat_access(mat, i, j), filler, mat->vec.el_size);
                        ++j;