strtrim: replace strchr with manual comparison

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
make mini_free NULL-safe

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
mini_init: catch errors from mini_finit

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>
replace for loops with more readable while loops

Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com>