lib

morphux C utility library
Log | Files | Refs | Submodules | README | LICENSE | git clone https://git.ne02ptzero.me/git/lib

commit 095ed7971d0f43597a33c3f39580002b6766d78a
parent 7b7845369a8e1ef96cc15aa9a0b971c1b391c936
Author: Ne02ptzero <louis@ne02ptzero.me>
Date:   Mon, 17 Jul 2017 19:05:08 +0200

Fix(Args): Add an assertion on callback validity

Diffstat:
Msrc/m_args.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/m_args.c b/src/m_args.c @@ -93,6 +93,8 @@ u32_t read_opt(const int ac, char **av, const mopts_t *opts, mlist_t **args) { } else { + /* Function pointer can't be NULL */ + assert(opts[it].callback); opts[it].callback(NULL); ret++; }