summaryrefslogtreecommitdiff
path: root/src/node_crypto_bio.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/node_crypto_bio.cc')
-rw-r--r--src/node_crypto_bio.cc4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/node_crypto_bio.cc b/src/node_crypto_bio.cc
index 4a71338edf..2a3ed936f8 100644
--- a/src/node_crypto_bio.cc
+++ b/src/node_crypto_bio.cc
@@ -427,9 +427,7 @@ char* NodeBIO::PeekWritable(size_t* size) {
TryAllocateForWrite(*size);
size_t available = write_head_->len_ - write_head_->write_pos_;
- if (*size != 0 && available > *size)
- available = *size;
- else
+ if (*size == 0 || available <= *size)
*size = available;
return write_head_->data_ + write_head_->write_pos_;