multitudes / 42-minishell

This project is about creating a simple shell
MIT License
0 stars 0 forks source link

Arguments for scanner error function in tokenizer correct? #206

Closed ProjektPhoenix closed 3 months ago

ProjektPhoenix commented 3 months ago

I think in the tokenizer funciton in scanner.c, when function scanner_error() is called, it should pass data and not &data !? So "scanner_error(data, "syntax error")" instead of "scanner_error(&data, "syntax error")"

multitudes commented 3 months ago

well the function signature is

bool    scanner_error(t_mini_data *data, char *err_str)
{
    stderr_and_status(err_str, 0);
    data->scanner_err_str = err_str;
    data->scanner_error = 2;
    return (true);
}

and minidata is alloc on the stack.