ft_strdup_till.c 1.0 KB

123456789101112131415161718
  1. /* ************************************************************************** */
  2. /* */
  3. /* ::: :::::::: */
  4. /* ft_strdup_till.c :+: :+: :+: */
  5. /* +:+ +:+ +:+ */
  6. /* By: mazimi <mazimi@student.42.fr> +#+ +:+ +#+ */
  7. /* +#+#+#+#+#+ +#+ */
  8. /* Created: 2014/11/08 17:49:42 by mazimi #+# #+# */
  9. /* Updated: 2014/12/26 12:58:54 by mazimi ### ########.fr */
  10. /* */
  11. /* ************************************************************************** */
  12. #include "../libft.h"
  13. char *ft_strdup_till(char *str, char c)
  14. {
  15. return (ft_strndup(str, ft_strlen(str) - ft_strlen(ft_strchr(str, c))));
  16. }