diff --git a/Makefile b/Makefile index 03779f0..e64c328 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ IDIR = . _DEPS = ft_printf.h DEPS = $(_DEPS:%.h=$(IDIR)/%.h) -LDIR = ./libft.c/ +LDIR = ./libft/ _LIBS = libft.a LIBS = $(_LIBS:lib%.a=%) diff --git a/ft_printf b/ft_printf index b12185b..37f794d 100755 Binary files a/ft_printf and b/ft_printf differ diff --git a/ft_printf.c b/ft_printf.c index d1d1812..3753c1a 100644 --- a/ft_printf.c +++ b/ft_printf.c @@ -156,12 +156,6 @@ ll ll ll ll ll . . . . . . . [int *] [n] [long *] [ln] [long long *] [lln] - -faire un itoa qui fonctionne pour les long int -faire un uitoa qui fonctionne pour les unsigned long int -comme ca [d i c] et [ld li] sont traites pareil, et -[u x X p] et [lu lx lX s] aussi - */ char *ft_convert(va_list ap, char *type) @@ -170,10 +164,11 @@ char *ft_convert(va_list ap, char *type) if (ft_strchr(type, 'h') || ft_strchr(type, 'l')) return (NULL); - if (ft_strchr("diuxXcspefgn", type[0])) + if (ft_strchr("efgn", type[0])) + return (NULL); + if (ft_strchr("diuxXcsp", type[0])) print = ft_itoa((int)va_arg(ap, int)); - printf("%s\n", print); - return (NULL); + return (print); } int ft_printf(char *string, ...) @@ -196,6 +191,7 @@ int ft_printf(char *string, ...) if (!(ft_expand_star(va_arg(ap, int), &s))) return (-1); print = ft_convert(ap, type); + printf("= %s | %s\n",s,print); // print = ft_flag_transform(s, print); // length += ft_put_word(print); } @@ -324,10 +320,10 @@ int main(int ac, char **av) ft_printf("%i", -23); // ft_printf_test(str2, i1, i2, i3, i4, i5, i6); } - if (ac == 2) + if (ac > 1) { - printf("[%s]\n", av[1]); - ft_printf(av[1]); + printf("\"%s\",%s,%s,%s\n", av[1], av[2], av[3], av[4]); + ft_printf(av[1],av[2],av[3],av[4]); } return (0); } diff --git a/ft_printf.h b/ft_printf.h index 77c0add..cb769cd 100644 --- a/ft_printf.h +++ b/ft_printf.h @@ -3,7 +3,7 @@ # include # include # include -# include "libft.c/libft.h" +# include "libft/libft.h" # include diff --git a/libft.c b/libft similarity index 100% rename from libft.c rename to libft