2022-10-06 20:30:03 -04:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
2022-10-23 13:01:50 -04:00
|
|
|
/* ft_isarg.c :+: :+: :+: */
|
2022-10-06 20:30:03 -04:00
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
2022-10-23 13:01:50 -04:00
|
|
|
/* Created: 2022/10/11 22:37:41 by cchauvet #+# #+# */
|
|
|
|
/* Updated: 2022/10/12 16:09:22 by cchauvet ### ########.fr */
|
2022-10-06 20:30:03 -04:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
2022-10-23 13:01:50 -04:00
|
|
|
#include "ft_printf.h"
|
2022-10-06 20:30:03 -04:00
|
|
|
|
2022-10-23 13:01:50 -04:00
|
|
|
int ft_isarg(int c)
|
2022-10-06 20:30:03 -04:00
|
|
|
{
|
2022-10-23 13:01:50 -04:00
|
|
|
char *flags;
|
|
|
|
|
|
|
|
if (c == '\0')
|
|
|
|
return (1);
|
|
|
|
flags = "cspdiuxX%";
|
|
|
|
while (*flags)
|
|
|
|
{
|
|
|
|
if (*flags == c)
|
|
|
|
return (1);
|
|
|
|
flags++;
|
|
|
|
}
|
2022-10-10 13:33:47 -04:00
|
|
|
return (0);
|
2022-10-06 20:30:03 -04:00
|
|
|
}
|