rectif de gen_tab pour copier les esc

This commit is contained in:
william 2017-03-09 17:53:02 +01:00
parent a9799debda
commit 00989fb490
2 changed files with 4 additions and 3 deletions

View file

@ -26,9 +26,9 @@ char **gen_tab(const char *pat,
{
len = ft_strlen(pat);
my_tab[0] = ft_strdup(pat);
my_tab[1] = (char *)dup_char_esc(esc, len >> 3);
my_tab[1] = (char *)dup_char_esc(esc, (len >> 3) + 1);
if (esc2)
my_tab[2] = (char *)dup_char_esc(esc2, len >> 3);
my_tab[2] = (char *)dup_char_esc(esc2, (len >> 3) + 1);
}
else
{

View file

@ -66,6 +66,7 @@ unsigned char *dup_char_esc(const unsigned char *esc, const int size)
if (!(new_esc = (unsigned char *)ft_strnew(size)))
return (NULL);
ft_memcpy(new_esc, esc, size);
new_esc = ft_memcpy(new_esc, esc, size);
return (new_esc);
}