Files

41 lines
1.2 KiB
C
Raw Permalink Normal View History

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_eoflags.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/26 10:13:59 by gbaconni #+# #+# */
2022-04-29 15:18:54 +02:00
/* Updated: 2022/04/29 14:36:20 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
2022-04-29 17:50:40 +02:00
#include "ft_printf.h"
int ft_eoflags(const char *s)
{
int ret;
int i;
const char *chars = SPECIFIERS;
ret = 0;
if (s == NULL)
return (ret);
while (*s != '\0')
{
i = 0;
while (chars[i] != '\0')
{
if (chars[i] == *s)
break ;
i++;
}
if (chars[i] != *s)
ret++;
else
break ;
s++;
}
return (ret);
}