-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclient.c
38 lines (35 loc) · 1.21 KB
/
client.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
28
29
30
31
32
33
34
35
36
37
38
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* client.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: amait-ou <amait-ou@student.1337.ma> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/12/31 22:56:15 by amait-ou #+# #+# */
/* Updated: 2023/03/05 15:49:58 by amait-ou ### ########.fr */
/* */
/* ************************************************************************** */
#include "minitalk.h"
void ft_client(pid_t pid, char *s)
{
while (*s)
{
ft_sender(pid, *s);
++s;
}
}
int main(int ac, char **ag)
{
if (ac <= 2)
{
ft_putstr("[!] Missing Arguments\n");
return (0);
}
if (ft_atoi(ag[1]) <= 0)
{
ft_putstr("[!] Invalid Process Id\n");
return (0);
}
ft_client(ft_atoi(ag[1]), ag[2]);
return (0);
}