-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathft_push_str.c
More file actions
27 lines (24 loc) · 1.1 KB
/
ft_push_str.c
File metadata and controls
27 lines (24 loc) · 1.1 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
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* ft_push_str.c :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fokrober <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2019/04/13 22:53:05 by fokrober #+# #+# */
/* Updated: 2019/04/23 14:50:10 by fokrober ### ########.fr */
/* */
/* ************************************************************************** */
#include "libft.h"
char **ft_push_str(char **tab, char *s)
{
size_t i;
i = 0;
while (tab[i])
i++;
tab[i] = s;
tab = (char**)ft_realloc(tab, (i + 1) * sizeof(char*),
(i + 2) * sizeof(char*));
tab[i + 1] = NULL;
return (tab);
}