-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.c
More file actions
44 lines (38 loc) · 1.19 KB
/
utils.c
File metadata and controls
44 lines (38 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
36
37
38
39
40
41
42
43
44
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* utils.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: gargrigo <gargrigo@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2026/02/20 16:55:01 by gargrigo #+# #+# */
/* Updated: 2026/02/26 15:37:47 by gargrigo ### ########.fr */
/* */
/* ************************************************************************** */
#include "ft_printf.h"
int ft_strlen(const char *str)
{
int i;
i = 0;
while (str[i])
i++;
return (i);
}
int ft_putchar(char c)
{
write(1, &c, 1);
return (1);
}
int ft_putstr(char *str)
{
int i;
i = 0;
if (!str)
{
write(1, "(null)", 6);
return (6);
}
while (str[i])
write(1, &str[i++], 1);
return (i);
}