-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_printf_add_to_buffer.c
More file actions
30 lines (28 loc) · 1.2 KB
/
ft_printf_add_to_buffer.c
File metadata and controls
30 lines (28 loc) · 1.2 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_printf_add_to_buffer.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: mfrisby <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2017/07/11 13:10:33 by mfrisby #+# #+# */
/* Updated: 2017/07/11 13:10:35 by mfrisby ### ########.fr */
/* */
/* ************************************************************************** */
#include "libftprintf.h"
void ft_printf_add_to_buffer(t_env *e, char *s, int start)
{
while (e->index <= 3999 && s[start])
{
e->result[e->index] = s[start];
e->index++;
e->size++;
start++;
}
if (e->index >= 3999)
{
e->result[e->index] = '\0';
ft_printf_buffer_flush(e);
ft_printf_add_to_buffer(e, s, start);
}
}