mirror of
https://codeberg.org/la-chouette/minishell.git
synced 2025-12-06 07:28:09 +01:00
31 lines
1.2 KiB
C
31 lines
1.2 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* buffer_charptr.c :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: kcolin <kcolin@42.fr> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/03/10 18:45:49 by kcolin #+# #+# */
|
|
/* Updated: 2025/03/10 18:46:35 by kcolin ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#include "buffer.h"
|
|
#include <stdlib.h>
|
|
|
|
/*
|
|
** Free this buffer, but return a pointer to the internal string, which is not
|
|
** freed.
|
|
**
|
|
** If buffer is null, return null.
|
|
*/
|
|
char *ft_buffer_to_charptr(t_buffer *buffer)
|
|
{
|
|
char *out;
|
|
|
|
if (buffer == NULL)
|
|
return (NULL);
|
|
out = buffer->buffer;
|
|
free(buffer);
|
|
return (out);
|
|
}
|