summaryrefslogtreecommitdiffstats
path: root/crypto/bio/bio_lib.c
diff options
context:
space:
mode:
authorBenjamin Kaduk <bkaduk@akamai.com>2016-10-28 11:53:00 -0500
committerRichard Levitte <levitte@openssl.org>2016-10-29 00:56:52 +0200
commit4e3973b457d42172711e2c556362826b02c44169 (patch)
tree9c8d8df7c4f5f1fab84fc3046c3052af19df0190 /crypto/bio/bio_lib.c
parentb509b6d787354141e776344782e46ab4c49cb6e9 (diff)
Try to unify BIO read/write parameter names
After the recent reworking, not everything matched up, and some comments didn't catch up to the outl-->dlen and inl-->dlen renames that happened during the development of the recent patches. Try to make parameter names consistent across header, implementation, and manual pages. Also remove some trailing whitespace that was inadvertently introduced. Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1798)
Diffstat (limited to 'crypto/bio/bio_lib.c')
-rw-r--r--crypto/bio/bio_lib.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/crypto/bio/bio_lib.c b/crypto/bio/bio_lib.c
index 2bd337c362..c14e238ddc 100644
--- a/crypto/bio/bio_lib.c
+++ b/crypto/bio/bio_lib.c
@@ -295,7 +295,7 @@ int BIO_read(BIO *b, void *data, int dlen)
ret = bio_read_intern(b, data, (size_t)dlen, &readbytes);
if (ret > 0) {
- /* *readbytes should always be <= outl */
+ /* *readbytes should always be <= dlen */
ret = (int)readbytes;
}
@@ -362,7 +362,7 @@ int BIO_write(BIO *b, const void *data, int dlen)
ret = bio_write_intern(b, data, (size_t)dlen, &written);
if (ret > 0) {
- /* *written should always be <= inl */
+ /* *written should always be <= dlen */
ret = (int)written;
}
@@ -383,7 +383,7 @@ int BIO_write_ex(BIO *b, const void *data, size_t dlen, size_t *written)
return ret;
}
-int BIO_puts(BIO *b, const char *in)
+int BIO_puts(BIO *b, const char *buf)
{
int ret;
size_t written = 0;
@@ -394,7 +394,7 @@ int BIO_puts(BIO *b, const char *in)
}
if (b->callback != NULL || b->callback_ex != NULL) {
- ret = (int)bio_call_callback(b, BIO_CB_PUTS, in, 0, 0, 0L, 1L, NULL);
+ ret = (int)bio_call_callback(b, BIO_CB_PUTS, buf, 0, 0, 0L, 1L, NULL);
if (ret <= 0)
return ret;
}
@@ -404,7 +404,7 @@ int BIO_puts(BIO *b, const char *in)
return -2;
}
- ret = b->method->bputs(b, in);
+ ret = b->method->bputs(b, buf);
if (ret > 0) {
b->num_write += (uint64_t)ret;
@@ -413,7 +413,7 @@ int BIO_puts(BIO *b, const char *in)
}
if (b->callback != NULL || b->callback_ex != NULL)
- ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, in, 0, 0,
+ ret = (int)bio_call_callback(b, BIO_CB_PUTS | BIO_CB_RETURN, buf, 0, 0,
0L, ret, &written);
if (ret > 0) {
@@ -428,7 +428,7 @@ int BIO_puts(BIO *b, const char *in)
return ret;
}
-int BIO_gets(BIO *b, char *out, int outl)
+int BIO_gets(BIO *b, char *buf, int size)
{
int ret;
size_t readbytes = 0;
@@ -438,13 +438,13 @@ int BIO_gets(BIO *b, char *out, int outl)
return (-2);
}
- if (outl < 0) {
+ if (size < 0) {
BIOerr(BIO_F_BIO_GETS, BIO_R_INVALID_ARGUMENT);
return 0;
}
if (b->callback != NULL || b->callback_ex != NULL) {
- ret = (int)bio_call_callback(b, BIO_CB_GETS, out, outl, 0, 0L, 1, NULL);
+ ret = (int)bio_call_callback(b, BIO_CB_GETS, buf, size, 0, 0L, 1, NULL);
if (ret <= 0)
return ret;
}
@@ -454,7 +454,7 @@ int BIO_gets(BIO *b, char *out, int outl)
return (-2);
}
- ret = b->method->bgets(b, out, outl);
+ ret = b->method->bgets(b, buf, size);
if (ret > 0) {
readbytes = ret;
@@ -462,12 +462,12 @@ int BIO_gets(BIO *b, char *out, int outl)
}
if (b->callback != NULL || b->callback_ex != NULL)
- ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, out, outl,
+ ret = (int)bio_call_callback(b, BIO_CB_GETS | BIO_CB_RETURN, buf, size,
0, 0L, ret, &readbytes);
if (ret > 0) {
/* Shouldn't happen */
- if (readbytes > (size_t)outl)
+ if (readbytes > (size_t)size)
ret = -1;
else
ret = (int)readbytes;