Commit graph

56 commits

Author SHA1 Message Date
AKP
4563b208a6
Fix sort
Sorting was broken due to a miscast of a void pointer.

qsort has an argumen for a comparison function of type
`int (*) (const void*, const void*)`, where the void is the type
of the items in the main array being sorted.

In this case, the array was of type `struct Rule*[]`. The
comparison function was being provided with `struct Rule**`s as
void pointers, which were being cast to `struct Rule*`s and used
like that, causing weird behaviour.

This commit corrects the typecast to cast to `struct Rule**` and
dereferences appropriately.
2023-10-06 22:34:33 +01:00
AKP
ebb9ce2690
Why does this sorting not sort 2023-10-06 15:10:36 +01:00
AKP
5fa87929e2
Parse rules from file 2023-10-06 12:31:49 +01:00
AKP
193d06e922
Alter 2 files
Update `parser.c`
Update `readFirewall.c`
2023-10-05 23:41:52 +01:00
AKP
061dedc40c
Initial parser implementation 2023-10-05 23:40:35 +01:00
AKP
f247ee0c6f
Initial commit 2023-09-28 16:01:14 +01:00