From 00e582e8a2665190da10c53d31d2ca9e0255beaa Mon Sep 17 00:00:00 2001 From: hugodu69 Date: Mon, 29 Jun 2020 23:42:35 +0200 Subject: [PATCH] tests with null pointer --- main.c | 7 +++++-- mainbis.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 644193d..895f95d 100644 --- a/main.c +++ b/main.c @@ -1,3 +1,4 @@ +#include "ft_printf.h" #include // for printf #include #include // for dup() and dup2() @@ -26,7 +27,9 @@ int ft_printf(char *string, ...); /* redirect output to file outft, and write result of ft_printf inside it */\ /* also compare return of both printf and ft_printf, pout and ftpout */\ dup2(outft, 1); \ - ftpout = ft_printf(string, ##args); \ + printf("_x_%s_x_",##args);\ + // ftpout = ft_printf(string, ##args); \ + write(1, "a", 1);\ if (ftpout == -1) printf("\033[91mERROR\033[0m"); \ fflush(stdout); \ printf("\n"); \ @@ -717,7 +720,7 @@ int main(int ac, char **av) PRINT("%%%%%i%%%%", 1); } - if (ac == 2 || !strcmp(av[2], "repetition")) + if (ac == 2 || !strcmp(av[2], "null")) { printf("\n----------------------------------------------------------------\n"); printf("with char NULL\n"); diff --git a/mainbis.c b/mainbis.c index df4f8ed..a13412b 100644 --- a/mainbis.c +++ b/mainbis.c @@ -2,5 +2,5 @@ int main(void) { - ft_printf("%s\n", "NULL"); + printf("%s\n", NULL); }