| 12345678910111213141516171819202122232425262728293031323334353637383940 |
- /* ************************************************************************** */
- /* */
- /* ::: :::::::: */
- /* ft_cptchar_glued.c :+: :+: :+: */
- /* +:+ +:+ +:+ */
- /* By: bchanot <bchanot@student.42.fr> +#+ +:+ +#+ */
- /* +#+#+#+#+#+ +#+ */
- /* Created: 2017/04/28 00:56:56 by bchanot #+# #+# */
- /* Updated: 2018/10/29 12:15:35 by bchanot ### ########.fr */
- /* */
- /* ************************************************************************** */
- #include "libft.h"
- size_t ft_cptchar_glued(const char *src, char c)
- {
- size_t i;
- size_t j;
- j = 0;
- if (!src || !ft_cptchar(src, c))
- return (0);
- while (*src)
- {
- if (*src == c)
- {
- i = 0;
- while (*src && *src == c)
- {
- src++;
- i++;
- }
- if (i > j)
- j = i;
- }
- else
- src++;
- }
- return (j);
- }
|