Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes for issue libconfuse#37: Do not use assert() for API input vali…
…dation This patch introduces a semantic change in the behavior of libConfuse on invalid input to API's. Replacing assert() for argument validation with a simple if() statement (inverted logic compared to asserts) with errno set to EINVAL and returning cfg_false, NULL or similar on error. Some API's, mostly cfg_*set*(), are declared to return void, others, cfg_*getint/float/bool*(), return the actual data value. The former set functions will be changed in a later patch to return a status (POSIX OK(0) or non-zero on error), and the latter will likely return zero on error, which means the user will have to consult errno to check for error. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
- Loading branch information