pourquoi il demande un buffer en parametre lui ?
This commit is contained in:
9
pwd.c
9
pwd.c
@ -6,7 +6,7 @@
|
|||||||
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/02/09 18:31:21 by tomoron #+# #+# */
|
/* 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"
|
#include "minishell.h"
|
||||||
@ -15,10 +15,9 @@ int pwd(void)
|
|||||||
{
|
{
|
||||||
char *buffer;
|
char *buffer;
|
||||||
|
|
||||||
buffer = malloc(1024 * 1024);
|
buffer = getcwd(NULL, 0);
|
||||||
if (!buffer)
|
if(!buffer)
|
||||||
return (1);
|
return(1);
|
||||||
getcwd(buffer, 1024 * 1024);
|
|
||||||
ft_printf("%s\n", buffer);
|
ft_printf("%s\n", buffer);
|
||||||
free(buffer);
|
free(buffer);
|
||||||
return (0);
|
return (0);
|
||||||
|
Reference in New Issue
Block a user