diff options
author | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-04-26 21:41:50 +0200 |
---|---|---|
committer | Michał Łyszczek <michal.lyszczek@bofc.pl> | 2018-04-26 21:41:50 +0200 |
commit | 96b49416b55838ed3324470b643b613cc42d0a3c (patch) | |
tree | 0fb759980b125ac0e91e0a20d35d0eeaf1bc43d0 | |
parent | 581ce669007b00e23da06dec5d480bb66ad92258 (diff) | |
download | embedlog-96b49416b55838ed3324470b643b613cc42d0a3c.tar.gz embedlog-96b49416b55838ed3324470b643b613cc42d0a3c.tar.bz2 embedlog-96b49416b55838ed3324470b643b613cc42d0a3c.zip |
add: couple more EINVAL checks for public functions
-rw-r--r-- | src/el-perror.c | 2 | ||||
-rw-r--r-- | src/el-pmemory.c | 3 | ||||
-rw-r--r-- | src/el-print.c | 1 | ||||
-rw-r--r-- | src/el-puts.c | 5 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/el-perror.c b/src/el-perror.c index a6dfa74..23fb3e3 100644 --- a/src/el-perror.c +++ b/src/el-perror.c @@ -72,6 +72,8 @@ static int el_ovperror /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ + VALID(EINVAL, options); + e = errno; rc = 0; diff --git a/src/el-pmemory.c b/src/el-pmemory.c index 408086d..a8cab30 100644 --- a/src/el-pmemory.c +++ b/src/el-pmemory.c @@ -222,9 +222,10 @@ int el_opmemory * no need to waste cycles on useless string preparation */ - VALID(ERANGE, el_log_allowed(options, level)); VALID(EINVAL, mem); VALID(EINVAL, mlen); + VALID(EINVAL, options); + VALID(ERANGE, el_log_allowed(options, level)); /* * print log table preamble that is: diff --git a/src/el-print.c b/src/el-print.c index 61d9a8e..9db5f6f 100644 --- a/src/el-print.c +++ b/src/el-print.c @@ -385,6 +385,7 @@ int el_ovprint VALID(EINVAL, fmt); + VALID(EINVAL, options); VALID(ERANGE, el_log_allowed(options, level)); VALID(ENODEV, options->outputs); diff --git a/src/el-puts.c b/src/el-puts.c index 9ba9d1e..26c4ceb 100644 --- a/src/el-puts.c +++ b/src/el-puts.c @@ -30,6 +30,7 @@ ========================================================================== */ + #if HAVE_CONFIG_H #include "config.h" #endif @@ -85,8 +86,8 @@ int el_oputs int rv; /* return value from function */ /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - VALID(EINVAL, options); VALID(EINVAL, s); + VALID(EINVAL, options); VALID(ENODEV, options->outputs != 0); rv = 0; @@ -171,9 +172,9 @@ int el_oputb /*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/ - VALID(EINVAL, options); VALID(EINVAL, mem); VALID(EINVAL, mlen); + VALID(EINVAL, options); VALID(ENODEV, options->outputs != 0); rv = 0; |