pourquoi il demande un buffer en parametre lui ?

This commit is contained in:
2024-02-16 21:20:10 +01:00
parent aeac20ccb0
commit 8d77586948

5
pwd.c
View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/09 18:31:21 by tomoron #+# #+# */
/* Updated: 2024/02/13 16:18:01 by marde-vr ### ########.fr */
/* Updated: 2024/02/16 21:19:30 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
#include "minishell.h"
@ -15,10 +15,9 @@ int pwd(void)
{
char *buffer;
buffer = malloc(1024 * 1024);
buffer = getcwd(NULL, 0);
if(!buffer)
return(1);
getcwd(buffer, 1024 * 1024);
ft_printf("%s\n", buffer);
free(buffer);
return (0);