pourquoi il demande un buffer en parametre lui ?
This commit is contained in:
5
pwd.c
5
pwd.c
@ -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);
|
||||
|
Reference in New Issue
Block a user