-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printf_utils_1.c
More file actions
46 lines (40 loc) · 1.29 KB
/
ft_printf_utils_1.c
File metadata and controls
46 lines (40 loc) · 1.29 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
45
46
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_utils_1.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: wphylici <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/07/20 17:17:58 by wphylici #+# #+# */
/* Updated: 2020/07/27 07:33:04 by wphylici ### ########.fr */
/* */
/* ************************************************************************** */
#include "includes/ft_printf.h"
int ft_strlen(char *str)
{
int i;
i = 0;
if (str == NULL)
return (-1);
while (str[i] != '\0')
i++;
return (i);
}
int ft_putstr_fd(char *str, int fd)
{
int len;
len = 0;
if (str != '\0')
len = write(fd, str, ft_strlen(str));
return (len);
}
char *ft_strchr(const char *s, int c)
{
while (*s != '\0')
{
if (*s == (char)c)
return ((char *)s);
s++;
}
return (NULL);
}