aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Łyszczek <michal.lyszczek@bofc.pl>2018-04-20 18:34:10 +0200
committerMichał Łyszczek <michal.lyszczek@bofc.pl>2018-04-20 18:34:10 +0200
commitddb1907b5d66e55f3e7325a081efb4b0eecc5763 (patch)
tree7db92104290122905fab6cf8fd16e463ea5dcbc7
parent14eed6c7468575cdde348b5ee879af05e81631a3 (diff)
downloadembedlog-ddb1907b5d66e55f3e7325a081efb4b0eecc5763.tar.gz
embedlog-ddb1907b5d66e55f3e7325a081efb4b0eecc5763.tar.bz2
embedlog-ddb1907b5d66e55f3e7325a081efb4b0eecc5763.zip
fix: clang analyzer warning
-rw-r--r--src/el-file.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/el-file.c b/src/el-file.c
index 8c051e7..b278692 100644
--- a/src/el-file.c
+++ b/src/el-file.c
@@ -553,15 +553,12 @@ int el_file_putb
)
{
- if (options->current_log && options->current_log[0] == '\0')
- {
- /*
- * file has not been opened, prevent segfault
- */
+ VALID(EINVAL, mem);
+ VALID(EINVAL, mlen);
+ VALID(EINVAL, options);
+ VALID(EBADF, options->current_log);
+ VALID(EBADF, options->current_log[0] != '\0');
- errno = EBADF;
- return -1;
- }
if (options->frotate_number)
{