summaryrefslogtreecommitdiffstats
path: root/src/s_lvars.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/s_lvars.c')
-rw-r--r--src/s_lvars.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/s_lvars.c b/src/s_lvars.c
index f2a1151..d9b7159 100644
--- a/src/s_lvars.c
+++ b/src/s_lvars.c
@@ -26,7 +26,7 @@ void
t_lvars *tmp;
tmp = *lvars;
- while (tmp && ft_strncmp(tmp->name, name, ft_strlen(name)))
+ while (tmp && ft_strncmp(tmp->name, name, ft_strlen(name) + 1))
{
tmp = tmp->next;
}
@@ -40,6 +40,12 @@ void
ft_dprintf(STDERR_FILENO, "%s\n", strerror(errno));
exit(FT_RET_ALLOC);
}
+ /* TODO: delete this */
+ tmp = *lvars;
+ while (tmp) {
+ ft_printf("[%s]: [%s]\n", tmp->name, tmp->val);
+ tmp = tmp->next;
+ }
}
void
@@ -50,7 +56,7 @@ void
t_lvars *prev;
tmp = *lvars;
- if (tmp != NULL && !ft_strncmp(tmp->name, name, ft_strlen(name)))
+ if (tmp != NULL && !ft_strncmp(tmp->name, name, ft_strlen(name) + 1))
{
*lvars = tmp->next;
ft_memdel((void*)&tmp->name);
@@ -58,7 +64,7 @@ void
ft_memdel((void*)&tmp);
return ;
}
- while (tmp && ft_strncmp(tmp->name, name, ft_strlen(name)))
+ while (tmp && ft_strncmp(tmp->name, name, ft_strlen(name) + 1))
{
prev = tmp;
tmp = tmp->next;