update: Updated stuff so the scanner works great now

This commit is contained in:
Maieul BOYER 2024-09-06 16:46:01 +02:00
parent 88c34b3904
commit 475038e2b7
No known key found for this signature in database
21 changed files with 787 additions and 340 deletions

View file

@ -65,11 +65,9 @@ t_error vec_heredoc_pop(t_vec_heredoc *vec, t_heredoc *value)
t_heredoc temp_value;
t_heredoc *ptr;
if (vec == NULL)
if (vec == NULL || vec->len == 0)
return (ERROR);
ptr = value;
if (vec->len == 0)
return (ERROR);
if (value == NULL)
ptr = &temp_value;
vec->len--;

View file

@ -17,9 +17,11 @@
t_heredoc *vec_heredoc_get(t_vec_heredoc *vec, t_usize i)
{
if (vec == NULL || vec->len >= i)
if (vec == NULL || vec->buffer == NULL)
return (NULL);
return (&vec->buffer[i]);
if (i < vec->len)
return (&vec->buffer[i]);
return (NULL);
}
t_heredoc *vec_heredoc_last(t_vec_heredoc *vec)