42_solong/libftx/printf/ft_isarg.c

30 lines
1.1 KiB
C
Raw Normal View History

2022-12-22 11:54:17 -05:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_isarg.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/10/11 22:37:41 by cchauvet #+# #+# */
2023-01-05 13:04:29 -05:00
/* Updated: 2023/01/05 18:26:24 by cchauvet ### ########.fr */
2022-12-22 11:54:17 -05:00
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_isarg(int c)
{
char *flags;
if (c == '\0')
return (1);
2023-01-05 13:04:29 -05:00
flags = "cspdiuxX%S";
2022-12-22 11:54:17 -05:00
while (*flags)
{
if (*flags == c)
return (1);
flags++;
}
return (0);
}