diff --git a/Makefile b/Makefile index 3d84efc..9604af3 100644 --- a/Makefile +++ b/Makefile @@ -6,14 +6,14 @@ # By: erey-bet +#+ +:+ +#+ # # +#+#+#+#+#+ +#+ # # Created: 2022/09/27 04:19:30 by erey-bet #+# #+# # -# Updated: 2022/10/15 15:39:56 by erey-bet ### ########.fr # +# Updated: 2022/11/22 21:00:41 by erey-bet ### ########.fr # # # # **************************************************************************** # SRCS = ft_get_size.c ft_power.c ft_printf.c ft_putchar.c ft_putnbr.c \ ft_putnbrhex.c ft_putnbrhex_upper.c ft_putstr.c ft_putunbr.c ft_putvd.c OBJS = ${SRCS:.c=.o} -CC = gcc +CC = clang CFLAGS = -Wall -Wextra -Werror NAME = libftprintf.a diff --git a/ft_putnbr.c b/ft_putnbr.c index 437d90f..eb2004a 100644 --- a/ft_putnbr.c +++ b/ft_putnbr.c @@ -6,7 +6,7 @@ /* By: erey-bet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/05 10:22:16 by erey-bet #+# #+# */ -/* Updated: 2022/10/10 22:49:10 by erey-bet ### ########.fr */ +/* Updated: 2022/11/22 21:08:14 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -20,7 +20,8 @@ int ft_putnbr(int n) count = 0; nl = n; - nl *= (n > 0) - (n < 0); + if (nl < 0) + nl *= nl - 1; len = ft_get_size(nl); if (n < 0) {