/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* ft_printf_flag_to_atoi.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: joelecle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/14 17:06:43 by joelecle #+# #+# */ /* Updated: 2020/02/14 17:06:43 by joelecle ### ########lyon.fr */ /* */ /* ************************************************************************** */ #include #include #include char *ft_printf_flag_to_atoi(char *str) { char *nstr; char *nnstr; int len; while (*str != '.' && *str) str++; while (*str != '-' && *str) str--; len = ft_strlchr(str, ' '); nnstr = ft_substr(str, 0, len); nstr = ft_strjoin(nnstr, str + len + 1); ft_memdel((void**)&nnstr); return (nstr); }