Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/boringssl.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@chromium.org>2015-08-28 22:39:49 +0300
committerAdam Langley <agl@google.com>2015-08-29 01:46:40 +0300
commitffadb3969f7e739ad3f8ccde67508f065d154fd1 (patch)
tree4561e5e7193d7fdf5362a3255f665f82049a8b99 /crypto/bio
parent26416e9dde31f0edaa24c13579846df651c0e23d (diff)
fread returns a size_t, not int.
Change-Id: I305fd40a887b1dedf23eeddfb5231fc61b355ea8 Reviewed-on: https://boringssl-review.googlesource.com/5762 Reviewed-by: Adam Langley <agl@google.com>
Diffstat (limited to 'crypto/bio')
-rw-r--r--crypto/bio/file.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/crypto/bio/file.c b/crypto/bio/file.c
index cef33b66..2d3ccfea 100644
--- a/crypto/bio/file.c
+++ b/crypto/bio/file.c
@@ -182,20 +182,19 @@ static int file_free(BIO *bio) {
}
static int file_read(BIO *b, char *out, int outl) {
- int ret = 0;
-
if (!b->init) {
return 0;
}
- ret = fread(out, 1, outl, (FILE *)b->ptr);
+ size_t ret = fread(out, 1, outl, (FILE *)b->ptr);
if (ret == 0 && ferror((FILE *)b->ptr)) {
OPENSSL_PUT_SYSTEM_ERROR(fread);
OPENSSL_PUT_ERROR(BIO, ERR_R_SYS_LIB);
- ret = -1;
+ return -1;
}
- return ret;
+ /* fread reads at most |outl| bytes, so |ret| fits in an int. */
+ return (int)ret;
}
static int file_write(BIO *b, const char *in, int inl) {