minishell/src/utils/ft_substr_safe.c
2025-02-26 16:24:30 +01:00

24 lines
1.1 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* ft_strdup_safe.c :+: :+: */
/* +:+ */
/* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/02/20 18:01:27 by whaffman #+# #+# */
/* Updated: 2025/02/20 18:04:53 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#include "minishell.h"
char *ft_substr_safe(t_minishell *minishell, const char *str,
unsigned int start, size_t len)
{
char *new_str;
new_str = ft_substr(str, start, len);
check_malloc(minishell, new_str);
return (new_str);
}