-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_check_width.c
More file actions
35 lines (33 loc) · 1.19 KB
/
ft_check_width.c
File metadata and controls
35 lines (33 loc) · 1.19 KB
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
28
29
30
31
32
33
34
35
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_check_width.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: aobshatk <aobshatk@mail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/29 20:33:10 by aobshatk #+# #+# */
/* Updated: 2025/01/04 17:58:43 by aobshatk ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
int ft_check_width(char **temp, int counter)
{
if (**temp == '0')
return (counter);
while (**temp >= 48 && **temp <= 57)
{
counter++;
(*temp)++;
}
if (**temp == '.')
{
counter++;
(*temp)++;
while (**temp >= 48 && **temp <= 57)
{
counter++;
(*temp)++;
}
}
return (counter);
}