dawnbeen / c_formatter_42

C language formatter for 42 norminette
GNU General Public License v3.0
176 stars 17 forks source link

`insert_void` not working for functions returning a pointer #37

Closed younesaassila closed 2 years ago

younesaassila commented 2 years ago

Works fine for functions returning normal type:

Before:

char test(){}

After:

char    test(void)
{
}

Doesn't work for functions returning a pointer:

Before:

char *test(){}

After:

char    *test()
{
}

Expected:

char    *test(void)
{
}

Fix: Edit regexp to work for function declarations with any number of * characters between type and function name