Skip to content

Commit

Permalink
Fixes for issue libconfuse#37: Do not use assert() for API input vali…
Browse files Browse the repository at this point in the history
…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
troglobit committed Oct 27, 2015
1 parent c7ffff2 commit a81d930
Showing 1 changed file with 178 additions and 51 deletions.

0 comments on commit a81d930

Please sign in to comment.