summaryrefslogtreecommitdiffstats
path: root/crypto/evp/bio_ok.c
diff options
context:
space:
mode:
authorAndy Polyakov <appro@openssl.org>2004-08-29 18:19:27 +0200
committerAndy Polyakov <appro@openssl.org>2004-08-29 18:19:27 +0200
commit746fc2526ffc17d57a5fb87568d01400cbcf62fd (patch)
tree8d2c6238feebf963f268b19fc838f0ee6d60cf31 /crypto/evp/bio_ok.c
parentcrypto/perlasm update primarily to unify Netware modules. Once it's verified (diff)
downloadopenssl-746fc2526ffc17d57a5fb87568d01400cbcf62fd.tar.xz
openssl-746fc2526ffc17d57a5fb87568d01400cbcf62fd.zip
Fix compiler warnings in crypto/evp/bio_ok.c as pointed out by Geoff.
Diffstat (limited to 'crypto/evp/bio_ok.c')
-rw-r--r--crypto/evp/bio_ok.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/crypto/evp/bio_ok.c b/crypto/evp/bio_ok.c
index 085d426abe..98bc1ab409 100644
--- a/crypto/evp/bio_ok.c
+++ b/crypto/evp/bio_ok.c
@@ -286,6 +286,8 @@ static int ok_write(BIO *b, const char *in, int inl)
int ret=0,n,i;
BIO_OK_CTX *ctx;
+ if (inl <= 0) return inl;
+
ctx=(BIO_OK_CTX *)b->ptr;
ret=inl;
@@ -321,7 +323,7 @@ static int ok_write(BIO *b, const char *in, int inl)
if ((in == NULL) || (inl <= 0)) return(0);
n= (inl+ ctx->buf_len > OK_BLOCK_SIZE+ OK_BLOCK_BLOCK) ?
- OK_BLOCK_SIZE+ OK_BLOCK_BLOCK- ctx->buf_len : inl;
+ (int)(OK_BLOCK_SIZE+OK_BLOCK_BLOCK-ctx->buf_len) : inl;
memcpy((unsigned char *)(&(ctx->buf[ctx->buf_len])),(unsigned char *)in,n);
ctx->buf_len+= n;
@@ -489,7 +491,7 @@ static void sig_in(BIO* b)
ctx=b->ptr;
md=&ctx->md;
- if(ctx->buf_len- ctx->buf_off < 2* md->digest->md_size) return;
+ if((int)(ctx->buf_len-ctx->buf_off) < 2*md->digest->md_size) return;
EVP_DigestInit_ex(md, md->digest, NULL);
memcpy(md->md_data, &(ctx->buf[ctx->buf_off]), md->digest->md_size);