diff --git a/pwd.c b/pwd.c index b864816..2605550 100755 --- a/pwd.c +++ b/pwd.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* 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); - if (!buffer) - return (1); - getcwd(buffer, 1024 * 1024); + buffer = getcwd(NULL, 0); + if(!buffer) + return(1); ft_printf("%s\n", buffer); free(buffer); return (0);