Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
yabtaour
GitHub Repository: yabtaour/Minishell-42
Path: blob/main/utils/ft_putstr_fd.c
1407 views
1
/* ************************************************************************** */
2
/* */
3
/* ::: :::::::: */
4
/* ft_putstr_fd.c :+: :+: :+: */
5
/* +:+ +:+ +:+ */
6
/* By: yabtaour <[email protected]> +#+ +:+ +#+ */
7
/* +#+#+#+#+#+ +#+ */
8
/* Created: 2022/07/26 18:17:39 by yabtaour #+# #+# */
9
/* Updated: 2022/07/26 18:17:40 by yabtaour ### ########.fr */
10
/* */
11
/* ************************************************************************** */
12
13
#include "../minishell.h"
14
15
void ft_putstr_fd(char *s, int fd)
16
{
17
int idx;
18
19
idx = 0;
20
if (s)
21
{
22
while (s[idx] != '\0')
23
{
24
write(fd, &s[idx], 1);
25
idx++;
26
}
27
}
28
}
29
30