]> git.ipfire.org Git - thirdparty/kmod.git/commit
shared: unify array trim handling
authorTobias Stoeckmann <tobias@stoeckmann.org>
Tue, 13 Aug 2024 17:51:24 +0000 (19:51 +0200)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Fri, 16 Aug 2024 05:00:26 +0000 (00:00 -0500)
commit0c2bd66e6b2528e8deee3dd8a53a1360bd3e4773
tree13c2d0117221c02e3098cb500b807c9cac9b452e
parentf4b858c704cd376fe338cbdc7d5809d3270b2691
shared: unify array trim handling

An error during array_realloc is always ignored if the idea
was to save memory by trimming an array.

Move two occurrences of same code into a single function for
easier reviewing.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/68
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
shared/array.c