/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* get_next_line_utils.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2019/10/08 08:52:59 by cacharle #+# #+# */ /* Updated: 2019/10/11 09:50:44 by cacharle ### ########.fr */ /* */ /* ************************************************************************** */ int find_newline(char *str) { int i; i = -1; while (str[++i]) if (str[i] == '\n') return (i); return (-1); } char *ft_strncpy(char *dest, const char *src, int n) { int i; i = 0; while (src[i] && i < n) { dest[i] = src[i]; i++; } while (i < n) dest[i++] = '\0'; return (dest); } int ft_strlen(char *str) { int counter; counter = 0; while (str[counter]) counter++; return (counter); }