-
Notifications
You must be signed in to change notification settings - Fork 0
/
ft_condense.c
36 lines (33 loc) · 1.13 KB
/
ft_condense.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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_condense.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jtrujill <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/21 12:58:57 by jtrujill #+# #+# */
/* Updated: 2016/12/21 12:59:33 by jtrujill ### ########.fr */
/* */
/* ************************************************************************** */
#include "fillit.h"
char *ft_condense(char *str)
{
int count;
int i;
i = 0;
while (str[i] != '\0')
{
if (count == 20)
{
str[i] = '\n';
count = 0;
i++;
}
if (str[i] == '\n')
str[i] = '.';
count++;
i++;
}
str[i] = '\0';
return (str);
}