Now converts unsigned values as unisgned - changed itoa_base to uitoa_base.
authorLukas Jiriste <ljiriste@student.42prague.com>
Fri, 15 Sep 2023 17:11:26 +0000 (19:11 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Fri, 15 Sep 2023 17:11:26 +0000 (19:11 +0200)
Libft
conversion.c

diff --git a/Libft b/Libft
index b1a54dd5836019e70a715e04420298092def5f3e..c87057b8ea8c228b81aeddf70f9836252217b771 160000 (submodule)
--- a/Libft
+++ b/Libft
@@ -1 +1 @@
-Subproject commit b1a54dd5836019e70a715e04420298092def5f3e
+Subproject commit c87057b8ea8c228b81aeddf70f9836252217b771
index d476bbd1e0a55e78dfc14b3abbd7c74eca1f421d..b1ee939876bd897430fc57f814be1362b0a9dfa3 100644 (file)
@@ -6,7 +6,7 @@
 /*   By: ljiriste <marvin@42.fr>                    +#+  +:+       +#+        */
 /*                                                +#+#+#+#+#+   +#+           */
 /*   Created: 2023/09/05 11:30:56 by ljiriste          #+#    #+#             */
-/*   Updated: 2023/09/15 15:32:41 by ljiriste         ###   ########.fr       */
+/*   Updated: 2023/09/15 18:52:33 by ljiriste         ###   ########.fr       */
 /*                                                                            */
 /* ************************************************************************** */
 
@@ -23,19 +23,19 @@ static char *base_str_constr(char type, va_list *args)
        if (type == 'd' || type == 'i')
                res = ft_itoa(va_arg(*args, int));
        else if (type == 'o')
-               res = ft_itoa_base(va_arg(*args, unsigned int), "01234567");
+               res = ft_uitoa_base(va_arg(*args, unsigned int), "01234567");
        else if (type == 'u')
-               res = ft_itoa_base(va_arg(*args, unsigned int), "0123456789");
+               res = ft_uitoa_base(va_arg(*args, unsigned int), "0123456789");
        else if (type == 'x')
-               res = ft_itoa_base(va_arg(*args, unsigned int), "0123456789abcdef");
+               res = ft_uitoa_base(va_arg(*args, unsigned int), "0123456789abcdef");
        else if (type == 'X')
-               res = ft_itoa_base(va_arg(*args, unsigned int), "0123456789ABCDEF");
+               res = ft_uitoa_base(va_arg(*args, unsigned int), "0123456789ABCDEF");
        else if (type == 'c')
                res = ft_ctoa(va_arg(*args, int));
        else if (type == 's')
                res = ft_strdup(va_arg(*args, char *));
        else if (type == 'p')
-               res = ft_itoa_base((intptr_t)va_arg(*args, void *), "0123456789abcdef");
+               res = ft_uitoa_base((uintptr_t)va_arg(*args, void *), "0123456789abcdef");
        return (res);
 }