-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_scan_flag.c
27 lines (26 loc) · 1.25 KB
/
ft_scan_flag.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_scan_flag.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: ohachim <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/03/04 15:35:24 by ohachim #+# #+# */
/* Updated: 2019/05/26 06:58:04 by ohachim ### ########.fr */
/* */
/* ************************************************************************** */
char ft_scan_flag(const char *format, int cursor)
{
if (format[cursor - 1] == 'h' && format[cursor - 2] == 'h')
return ('H');
else if (format[cursor - 1] == 'h')
return ('h');
else if (format[cursor - 1] == 'l' && format[cursor - 2] == 'l')
return ('L');
else if (format[cursor - 1] == 'l')
return ('l');
else if (format[cursor - 1] == 'L')
return ('I');
else
return (0);
}