mirror of
https://github.com/openssl/openssl.git
synced 2025-02-23 14:42:15 +08:00
BIO_write_ex(): Make handing of BIO b == NULL and dlen == 0 less redundant
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/15722)
This commit is contained in:
parent
1d8897176d
commit
bb19b9d456
@ -393,13 +393,8 @@ int BIO_write(BIO *b, const void *data, int dlen)
|
||||
|
||||
int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written)
|
||||
{
|
||||
if (dlen == 0) {
|
||||
/* no error */
|
||||
if (written != NULL)
|
||||
*written = 0;
|
||||
return 1;
|
||||
}
|
||||
return bio_write_intern(b, data, dlen, written) > 0;
|
||||
return bio_write_intern(b, data, dlen, written) > 0
|
||||
|| (b != NULL && dlen == 0); /* order is important for *written */
|
||||
}
|
||||
|
||||
int BIO_puts(BIO *b, const char *buf)
|
||||
|
Loading…
Reference in New Issue
Block a user