Files
ft_printf/libftprintf/ft_eoflags.c

41 lines
1.2 KiB
C
Raw Normal View History

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_eoflags.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/04/26 10:13:59 by gbaconni #+# #+# */
2022-04-26 17:53:39 +02:00
/* Updated: 2022/04/26 13:24:34 by gbaconni ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
int ft_eoflags(const char *s)
{
int ret;
int i;
const char *chars = "cspdiuxX%";
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);
}