diff options
| author | @syxhe <https://t.me/syxhe> | 2025-04-17 15:36:28 -0500 |
|---|---|---|
| committer | @syxhe <https://t.me/syxhe> | 2025-04-17 15:36:28 -0500 |
| commit | ed4a91bcc1d68c26cd533c4432f93c799b1771c2 (patch) | |
| tree | 4df6d665ecc83706c9837d4a832b18fac505f229 /src/main.c | |
| parent | 9d3c8770ec63fe3e02f82bdc244e63d701492322 (diff) | |
Slight improvement to scandirlist function to properly free memory on error
Diffstat (limited to 'src/main.c')
| -rw-r--r-- | src/main.c | 9 |
1 files changed, 1 insertions, 8 deletions
| @@ -22,13 +22,6 @@ int printnames(void *data) { | |||
| 22 | return 0; | 22 | return 0; |
| 23 | } | 23 | } |
| 24 | int main() { | 24 | int main() { |
| 25 | // error(1, ENOTSUP, "No main file lol"); | 25 | error(1, ENOTSUP, "No main file lol"); |
| 26 | |||
| 27 | // Test code to showcase the scanner function | ||
| 28 | |||
| 29 | dlinkedlist *ll = scandirlist(".", lol, alphasort); | ||
| 30 | dlinkedlist_foreach(ll, printnames); | ||
| 31 | dlinkedlist_free(ll); | ||
| 32 | |||
| 33 | return 0; | 26 | return 0; |
| 34 | } \ No newline at end of file | 27 | } \ No newline at end of file |
