diff options
author | Richard Levitte <levitte@openssl.org> | 2020-11-04 16:14:00 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-13 09:35:31 +0100 |
commit | a150f8e1fcc38752fef4d7c75d765d8efc7d46d6 (patch) | |
tree | f7f62c9a5d8407d8b17820fbef67378aa7b9ddbb /crypto/comp/c_zlib.c | |
parent | 9311d0c471ca2eaa259e8c1bbbeb7c46394c7ba2 (diff) |
CRYPTO: refactor ERR_raise()+ERR_add_error_data() to ERR_raise_data()
This is not done absolutely everywhere, as there are places where
the use of ERR_add_error_data() is quite complex, but at least the
simple cases are done.
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13318)
Diffstat (limited to 'crypto/comp/c_zlib.c')
-rw-r--r-- | crypto/comp/c_zlib.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c index 0211da9b91..5d69dc96d2 100644 --- a/crypto/comp/c_zlib.c +++ b/crypto/comp/c_zlib.c @@ -397,8 +397,8 @@ static int bio_zlib_read(BIO *b, char *out, int outl) while (zin->avail_in) { ret = inflate(zin, 0); if ((ret != Z_OK) && (ret != Z_STREAM_END)) { - ERR_raise(ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR); - ERR_add_error_data(2, "zlib error:", zError(ret)); + ERR_raise_data(ERR_LIB_COMP, COMP_R_ZLIB_INFLATE_ERROR, + "zlib error: %s", zError(ret)); return 0; } /* If EOF or we've read everything then return */ @@ -483,8 +483,8 @@ static int bio_zlib_write(BIO *b, const char *in, int inl) /* Compress some more */ ret = deflate(zout, 0); if (ret != Z_OK) { - ERR_raise(ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR); - ERR_add_error_data(2, "zlib error:", zError(ret)); + ERR_raise_data(ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR, + "zlib error: %s", zError(ret)); return 0; } ctx->ocount = ctx->obufsize - zout->avail_out; @@ -532,8 +532,8 @@ static int bio_zlib_flush(BIO *b) if (ret == Z_STREAM_END) ctx->odone = 1; else if (ret != Z_OK) { - ERR_raise(ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR); - ERR_add_error_data(2, "zlib error:", zError(ret)); + ERR_raise_data(ERR_LIB_COMP, COMP_R_ZLIB_DEFLATE_ERROR, + "zlib error: %s", zError(ret)); return 0; } ctx->ocount = ctx->obufsize - zout->avail_out; |