-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathft_upper_left.c
40 lines (37 loc) · 1.25 KB
/
ft_upper_left.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
39
40
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_upper_left.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jtrujill <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/18 20:48:14 by jtrujill #+# #+# */
/* Updated: 2016/12/19 16:03:33 by jtrujill ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
char *ft_upper_left(char *str)
{
int i;
int j;
int count;
i = 0;
j = 0;
while (str[i] != '\0')
{
count = 0;
while (str[i] != '#')
i++;
while (count < 19)
{
i = ft_index(str, i, i);
while (str[i] != '\n' && count++ < 20)
str[j++] = str[i++];
while (count++ < 20)
str[j++] = '.';
}
str[j++] = '\n';
i++;
}
return (str);
}