]> Sergey Matveev's repositories - nnn.git/commit
Improved chunk allocation logic
authorKlzXS <klzx+github@klzx.cf>
Tue, 2 Aug 2022 19:22:42 +0000 (21:22 +0200)
committerKlzXS <klzx+github@klzx.cf>
Wed, 3 Aug 2022 15:38:19 +0000 (17:38 +0200)
commit65dec55e23a504c28d24c003c48f0a8e986a4210
treeb6707c90b426bb377c812136fa5443d3c56a93c0
parentab9d8bee8921a125391e0cc5eaa95e1b2b32799d
Improved chunk allocation logic

Found memory deallocation edge case

Update and move chunk limit check

Generalize maximum size of input

Remove hard-coded values

Remove superfluous check before free

Let the kernel deal with extra data

Handle signals while reading

Conform to the manpage

Make CI happy

use `size_t` instead of `ssize_t`

`ssize_t` was used just so `--i` when `i` was zero would become -1
instead of SIZE_MAX. for looping through something in reverse order, the
"goes-to" operator (`-->`) can be used instead which doesn't require `i`
to be signed anymore.

remove useless blank line

use a normal loop

don't see any reason why freeing in reverse order would've been needed.

Co-authored-by: N-R-K <nrk@disroot.org>
src/nnn.c