Add files via upload

This commit is contained in:
Raphaël 2023-12-14 18:18:31 +01:00 committed by GitHub
parent 3b7d261780
commit 353c59c2ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View file

@ -6,12 +6,12 @@
# By: rparodi <marvin@42.fr> +#+ +:+ +#+ # # By: rparodi <marvin@42.fr> +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2023/11/12 11:05:05 by rparodi #+# #+# # # Created: 2023/11/12 11:05:05 by rparodi #+# #+# #
# Updated: 2023/11/24 16:24:21 by rparodi ### ########.fr # # Updated: 2023/12/14 18:16:54 by raphael ### ########.fr #
# # # #
# **************************************************************************** # # **************************************************************************** #
NAME=libftprintf.a NAME=libftprintf.a
CC=cc CC=clang
CFLAGS=-Wall -Wextra -Werror CFLAGS=-Wall -Wextra -Werror
RM=rm -f RM=rm -f
LIBFT = ./libft/ft_strdup.c ./libft/ft_strlcpy.c ./libft/ft_strlen.c LIBFT = ./libft/ft_strdup.c ./libft/ft_strlcpy.c ./libft/ft_strlen.c

View file

@ -6,7 +6,7 @@
/* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */ /* By: rparodi <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2023/11/14 17:27:44 by rparodi #+# #+# */ /* Created: 2023/11/14 17:27:44 by rparodi #+# #+# */
/* Updated: 2023/11/16 12:14:01 by rparodi ### ########.fr */ /* Updated: 2023/12/14 18:17:22 by raphael ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -40,7 +40,6 @@ int ft_check_args(char c, va_list args, int *ret_value)
int ft_printf(const char *s, ...) int ft_printf(const char *s, ...)
{ {
size_t i; size_t i;
int nb_flag;
va_list args; va_list args;
char *str; char *str;
int ret_value; int ret_value;
@ -49,12 +48,11 @@ int ft_printf(const char *s, ...)
str = ft_strdup(s); str = ft_strdup(s);
va_start(args, s); va_start(args, s);
i = 0; i = 0;
nb_flag = 0;
while (str[i]) while (str[i])
{ {
if (str[i] == '%') if (str[i] == '%')
{ {
nb_flag += ft_check_args(str[i + 1], args, &ret_value); ft_check_args(str[i + 1], args, &ret_value);
i++; i++;
} }
else else